From 34f1923b00c91d32453b23ff5b1f1e589c55d066 Mon Sep 17 00:00:00 2001 From: MikhailTryakhov Date: Sun, 29 Aug 2021 16:59:16 -0700 Subject: [PATCH 1/3] regenerated sdk for 03-01 version --- ...iveConnectivityConfigurationsOperations.cs | 262 +++ ...ivityConfigurationsOperationsExtensions.cs | 71 + .../ActiveSecurityAdminRulesOperations.cs | 262 +++ ...eSecurityAdminRulesOperationsExtensions.cs | 71 + .../ActiveSecurityUserRulesOperations.cs | 262 +++ ...veSecurityUserRulesOperationsExtensions.cs | 71 + .../AdminRuleCollectionsOperations.cs | 1107 +++++++++++ ...dminRuleCollectionsOperationsExtensions.cs | 288 +++ .../src/Generated/AdminRulesOperations.cs | 1141 ++++++++++++ .../AdminRulesOperationsExtensions.cs | 308 ++++ ...wayPrivateEndpointConnectionsOperations.cs | 12 +- ...onGatewayPrivateLinkResourcesOperations.cs | 2 +- .../ApplicationGatewaysOperations.cs | 34 +- .../ApplicationSecurityGroupsOperations.cs | 12 +- .../AvailableDelegationsOperations.cs | 2 +- .../AvailableEndpointServicesOperations.cs | 2 +- ...AvailablePrivateEndpointTypesOperations.cs | 4 +- ...lableResourceGroupDelegationsOperations.cs | 2 +- .../AvailableServiceAliasesOperations.cs | 4 +- .../AzureFirewallFqdnTagsOperations.cs | 2 +- .../src/Generated/AzureFirewallsOperations.cs | 12 +- .../src/Generated/BastionHostsOperations.cs | 10 +- .../BgpServiceCommunitiesOperations.cs | 2 +- .../Generated/ConnectionMonitorsOperations.cs | 16 +- ...> ConnectivityConfigurationsOperations.cs} | 374 ++-- ...ivityConfigurationsOperationsExtensions.cs | 270 +++ .../Generated/CustomIPPrefixesOperations.cs | 16 +- .../Generated/DdosCustomPoliciesOperations.cs | 8 +- .../DdosProtectionPlansOperations.cs | 12 +- .../DefaultSecurityRulesOperations.cs | 4 +- .../Generated/DscpConfigurationOperations.cs | 10 +- ...iveConnectivityConfigurationsOperations.cs | 263 +++ ...ivityConfigurationsOperationsExtensions.cs | 73 + .../EffectiveVirtualNetworksOperations.cs | 507 ++++++ ...tiveVirtualNetworksOperationsExtensions.cs | 143 ++ ...essRouteCircuitAuthorizationsOperations.cs | 8 +- ...xpressRouteCircuitConnectionsOperations.cs | 8 +- .../ExpressRouteCircuitPeeringsOperations.cs | 8 +- .../ExpressRouteCircuitsOperations.cs | 22 +- .../ExpressRouteConnectionsOperations.cs | 8 +- ...sRouteCrossConnectionPeeringsOperations.cs | 8 +- .../ExpressRouteCrossConnectionsOperations.cs | 16 +- .../ExpressRouteGatewaysOperations.cs | 12 +- .../Generated/ExpressRouteLinksOperations.cs | 4 +- .../ExpressRoutePortsLocationsOperations.cs | 4 +- .../Generated/ExpressRoutePortsOperations.cs | 14 +- .../ExpressRouteServiceProvidersOperations.cs | 2 +- .../Generated/FirewallPoliciesOperations.cs | 10 +- ...allPolicyRuleCollectionGroupsOperations.cs | 8 +- .../src/Generated/FlowLogsOperations.cs | 10 +- .../src/Generated/HubRouteTablesOperations.cs | 8 +- .../HubVirtualNetworkConnectionsOperations.cs | 8 +- ...iveConnectivityConfigurationsOperations.cs | 55 + .../IActiveSecurityAdminRulesOperations.cs | 55 + .../IActiveSecurityUserRulesOperations.cs | 55 + .../IAdminRuleCollectionsOperations.cs | 186 ++ .../src/Generated/IAdminRulesOperations.cs | 196 ++ .../IConnectivityConfigurationsOperations.cs | 175 ++ ...iveConnectivityConfigurationsOperations.cs | 56 + .../IEffectiveVirtualNetworksOperations.cs | 96 + .../src/Generated/ILoadBalancersOperations.cs | 44 - .../src/Generated/INetworkGroupsOperations.cs | 174 ++ .../src/Generated/INetworkManagementClient.cs | 100 +- .../INetworkManagerCommitsOperations.cs | 55 + ...etworkManagerDeploymentStatusOperations.cs | 56 + ...erEffectiveSecurityAdminRulesOperations.cs | 56 + .../Generated/INetworkManagersOperations.cs | 235 +++ ...> INetworkSecurityPerimetersOperations.cs} | 110 +- ...imeterAssociableResourceTypesOperations.cs | 50 + .../ISecurityAdminConfigurationsOperations.cs | 170 ++ .../ISecurityUserConfigurationsOperations.cs | 170 ++ .../IUserRuleCollectionsOperations.cs | 185 ++ .../src/Generated/IUserRulesOperations.cs | 196 ++ .../IVirtualNetworkPeeringsOperations.cs | 14 +- .../Generated/InboundNatRulesOperations.cs | 12 +- .../InboundSecurityRuleOperations.cs | 2 +- .../src/Generated/IpAllocationsOperations.cs | 12 +- .../src/Generated/IpGroupsOperations.cs | 12 +- ...adBalancerBackendAddressPoolsOperations.cs | 8 +- ...ancerFrontendIPConfigurationsOperations.cs | 4 +- ...oadBalancerLoadBalancingRulesOperations.cs | 4 +- ...LoadBalancerNetworkInterfacesOperations.cs | 2 +- .../LoadBalancerOutboundRulesOperations.cs | 4 +- .../Generated/LoadBalancerProbesOperations.cs | 4 +- .../src/Generated/LoadBalancersOperations.cs | 216 +-- .../LoadBalancersOperationsExtensions.cs | 74 - .../LocalNetworkGatewaysOperations.cs | 10 +- .../Models/ActiveBaseSecurityAdminRule.cs | 124 ++ .../Models/ActiveBaseSecurityUserRule.cs | 122 ++ .../Models/ActiveConfigurationParameter.cs | 67 + .../Models/ActiveConnectivityConfiguration.cs | 91 + ...iveConnectivityConfigurationsListResult.cs | 70 + .../Models/ActiveDefaultSecurityAdminRule.cs | 183 ++ .../Models/ActiveDefaultSecurityUserRule.cs | 160 ++ .../Models/ActiveSecurityAdminRule.cs | 203 +++ .../ActiveSecurityAdminRulesListResult.cs | 70 + .../Models/ActiveSecurityUserRule.cs | 166 ++ .../ActiveSecurityUserRulesListResult.cs | 70 + .../src/Generated/Models/AddressPrefixItem.cs | 61 + .../src/Generated/Models/AddressPrefixType.cs | 22 + .../src/Generated/Models/AdminRule.cs | 196 ++ .../Generated/Models/ApplicationGateway.cs | 10 + ...icationGatewayBackendHealthHttpSettings.cs | 10 + .../ApplicationGatewayBackendHealthServer.cs | 13 + ...icationGatewayPrivateEndpointConnection.cs | 13 + ...licationGatewayTrustedClientCertificate.cs | 19 +- .../Generated/Models/BackendAddressPool.cs | 11 +- .../src/Generated/Models/BaseAdminRule.cs | 58 + .../src/Generated/Models/BaseUserRule.cs | 58 + .../src/Generated/Models/BastionHost.cs | 10 +- .../Generated/Models/ConfigurationGroup.cs | 111 ++ .../src/Generated/Models/ConfigurationType.cs | 23 + .../Models/ConnectivityConfiguration.cs | 151 ++ .../Generated/Models/ConnectivityGroupItem.cs | 78 + .../Generated/Models/ConnectivityTopology.cs | 22 + ...unnelInterfaceType.cs => CreatedByType.cs} | 11 +- .../src/Generated/Models/CustomIpPrefix.cs | 60 +- .../src/Generated/Models/DefaultAdminRule.cs | 174 ++ .../src/Generated/Models/DefaultUserRule.cs | 151 ++ ...onHostSkuName.cs => DeleteExistingNSGs.cs} | 8 +- .../Generated/Models/DeleteExistingPeering.cs | 22 + .../src/Generated/Models/DeploymentStatus.cs | 24 + .../Models/EffectiveBaseSecurityAdminRule.cs | 108 ++ .../EffectiveConnectivityConfiguration.cs | 155 ++ .../EffectiveDefaultSecurityAdminRule.cs | 181 ++ ...ffectiveNetworkSecurityGroupAssociation.cs | 11 +- .../Models/EffectiveSecurityAdminRule.cs | 201 ++ .../Models/EffectiveVirtualNetwork.cs | 69 + .../EffectiveVirtualNetworksListResult.cs | 68 + .../EffectiveVirtualNetworksParameter.cs | 64 + .../src/Generated/Models/ExtendedLocation.cs | 31 +- .../Models/FrontendIpConfiguration.cs | 24 +- .../GatewayLoadBalancerTunnelInterface.cs | 86 - ...TunnelProtocol.cs => GroupConnectivity.cs} | 7 +- .../Models/{Sku.cs => GroupMembersItem.cs} | 24 +- .../src/Generated/Models/Hub.cs | 59 + .../Generated/Models/HubIpConfiguration.cs | 13 + .../src/Generated/Models/IPConfiguration.cs | 13 + .../src/Generated/Models/InboundNatRule.cs | 13 + ...{SyncRemoteAddressSpace.cs => IsGlobal.cs} | 7 +- .../src/Generated/Models/LoadBalancer.cs | 73 + .../src/Generated/Models/LoadBalancerSku.cs | 4 +- .../Generated/Models/LoadBalancerSkuName.cs | 1 - .../Models/LoadBalancerVipSwapRequest.cs | 55 - ...erVipSwapRequestFrontendIPConfiguration.cs | 66 - .../src/Generated/Models/LoadBalancingRule.cs | 13 +- .../src/Generated/Models/MembershipType.cs | 22 + .../src/Generated/Models/NetworkGroup.cs | 118 ++ .../NetworkGroupsCreateOrUpdateHeaders.cs | 53 + .../src/Generated/Models/NetworkInterface.cs | 53 +- .../Models/NetworkInterfaceIpConfiguration.cs | 44 +- .../NetworkInterfaceTapConfiguration.cs | 13 + .../src/Generated/Models/NetworkManager.cs | 120 ++ .../Generated/Models/NetworkManagerCommit.cs | 79 + .../Models/NetworkManagerDeploymentStatus.cs | 99 + ...etworkManagerDeploymentStatusListResult.cs | 68 + ...NetworkManagerDeploymentStatusParameter.cs | 74 + ...tiveConnectivityConfigurationListResult.cs | 70 + ...erEffectiveSecurityAdminRulesListResult.cs | 70 + ...rkManagerPropertiesNetworkManagerScopes.cs | 63 + .../Models/NetworkManagerSecurityGroupItem.cs | 53 + .../Models/NetworkSecurityPerimeter.cs | 94 + .../Models/PerimeterAssociableResource.cs | 84 + .../PerimeterAssociableResourcesListResult.cs | 65 + .../src/Generated/Models/PolicySettings.cs | 4 + .../src/Generated/Models/PrivateEndpoint.cs | 23 + .../Models/PrivateEndpointConnection.cs | 13 + .../Generated/Models/PrivateLinkService.cs | 43 + .../src/Generated/Models/ProxyResource.cs | 79 + .../src/Generated/Models/PublicIPPrefix.cs | 13 + .../src/Generated/Models/PublicIpAddress.cs | 38 +- .../Generated/Models/QueryRequestOptions.cs | 55 + .../src/Generated/Models/RuleCollection.cs | 100 + .../Generated/Models/SecurityConfiguration.cs | 111 ++ ....cs => SecurityConfigurationRuleAccess.cs} | 10 +- .../SecurityConfigurationRuleDirection.cs | 22 + .../SecurityConfigurationRuleProtocol.cs | 26 + .../src/Generated/Models/SecurityType.cs | 22 + .../src/Generated/Models/SystemData.cs | 103 ++ .../{DeleteOptions.cs => UseHubGateway.cs} | 8 +- .../src/Generated/Models/UserRule.cs | 159 ++ .../src/Generated/Models/VirtualHub.cs | 13 +- .../src/Generated/Models/VirtualNetwork.cs | 16 +- .../Generated/Models/VirtualNetworkGateway.cs | 45 +- .../Models/VirtualNetworkGatewayConnection.cs | 19 +- .../Models/VirtualNetworkGatewayNatRule.cs | 140 -- .../Generated/Models/VirtualNetworkPeering.cs | 33 +- .../Models/VirtualNetworkPeeringLevel.cs | 24 - .../src/Generated/Models/VirtualNetworkTap.cs | 27 + .../src/Generated/NatGatewaysOperations.cs | 12 +- .../src/Generated/NatRulesOperations.cs | 8 +- .../src/Generated/NetworkGroupsOperations.cs | 1096 +++++++++++ .../NetworkGroupsOperationsExtensions.cs | 270 +++ ...workInterfaceIPConfigurationsOperations.cs | 4 +- ...NetworkInterfaceLoadBalancersOperations.cs | 2 +- ...orkInterfaceTapConfigurationsOperations.cs | 12 +- .../Generated/NetworkInterfacesOperations.cs | 26 +- .../src/Generated/NetworkManagementClient.cs | 146 +- .../NetworkManagerCommitsOperations.cs | 262 +++ ...tworkManagerCommitsOperationsExtensions.cs | 71 + ...etworkManagerDeploymentStatusOperations.cs | 262 +++ ...gerDeploymentStatusOperationsExtensions.cs | 71 + ...erEffectiveSecurityAdminRulesOperations.cs | 262 +++ ...eSecurityAdminRulesOperationsExtensions.cs | 71 + .../Generated/NetworkManagersOperations.cs | 1618 +++++++++++++++++ .../NetworkManagersOperationsExtensions.cs | 364 ++++ .../Generated/NetworkProfilesOperations.cs | 12 +- .../NetworkSecurityGroupsOperations.cs | 12 +- .../NetworkSecurityPerimetersOperations.cs | 1410 ++++++++++++++ ...kSecurityPerimetersOperationsExtensions.cs | 318 ++++ .../NetworkVirtualAppliancesOperations.cs | 12 +- .../Generated/NetworkWatchersOperations.cs | 36 +- .../src/Generated/Operations.cs | 2 +- .../src/Generated/P2sVpnGatewaysOperations.cs | 22 +- .../src/Generated/PacketCapturesOperations.cs | 12 +- ...xpressRouteCircuitConnectionsOperations.cs | 4 +- ...imeterAssociableResourceTypesOperations.cs | 240 +++ ...ciableResourceTypesOperationsExtensions.cs | 61 + .../PrivateDnsZoneGroupsOperations.cs | 8 +- .../Generated/PrivateEndpointsOperations.cs | 14 +- .../PrivateLinkServicesOperations.cs | 34 +- .../Generated/PublicIPPrefixesOperations.cs | 16 +- .../Generated/PublicIpAddressesOperations.cs | 22 +- .../ResourceNavigationLinksOperations.cs | 2 +- .../Generated/RouteFilterRulesOperations.cs | 8 +- .../src/Generated/RouteFiltersOperations.cs | 12 +- .../src/Generated/RouteTablesOperations.cs | 12 +- .../src/Generated/RoutesOperations.cs | 8 +- .../SdkInfo_NetworkManagementClient.cs | 265 +-- .../SecurityAdminConfigurationsOperations.cs | 1071 +++++++++++ ...AdminConfigurationsOperationsExtensions.cs | 264 +++ .../SecurityPartnerProvidersOperations.cs | 12 +- .../src/Generated/SecurityRulesOperations.cs | 8 +- .../SecurityUserConfigurationsOperations.cs | 1071 +++++++++++ ...yUserConfigurationsOperationsExtensions.cs | 264 +++ .../ServiceAssociationLinksOperations.cs | 2 +- .../ServiceEndpointPoliciesOperations.cs | 12 +- ...viceEndpointPolicyDefinitionsOperations.cs | 8 +- .../src/Generated/ServiceTagsOperations.cs | 2 +- .../src/Generated/SubnetsOperations.cs | 12 +- .../src/Generated/UsagesOperations.cs | 2 +- .../UserRuleCollectionsOperations.cs | 1107 +++++++++++ ...UserRuleCollectionsOperationsExtensions.cs | 288 +++ .../src/Generated/UserRulesOperations.cs | 1141 ++++++++++++ .../UserRulesOperationsExtensions.cs | 308 ++++ .../VirtualApplianceSitesOperations.cs | 8 +- .../VirtualApplianceSkusOperations.cs | 4 +- .../VirtualHubBgpConnectionOperations.cs | 6 +- .../VirtualHubBgpConnectionsOperations.cs | 6 +- .../VirtualHubIpConfigurationOperations.cs | 12 +- .../VirtualHubRouteTableV2sOperations.cs | 8 +- .../src/Generated/VirtualHubsOperations.cs | 14 +- ...tualNetworkGatewayConnectionsOperations.cs | 24 +- ...workGatewayNatRulesOperationsExtensions.cs | 339 ---- .../VirtualNetworkGatewaysOperations.cs | 44 +- .../VirtualNetworkPeeringsOperations.cs | 29 +- ...tualNetworkPeeringsOperationsExtensions.cs | 36 +- .../Generated/VirtualNetworkTapsOperations.cs | 16 +- .../Generated/VirtualNetworksOperations.cs | 16 +- .../VirtualRouterPeeringsOperations.cs | 8 +- .../src/Generated/VirtualRoutersOperations.cs | 10 +- .../src/Generated/VirtualWANsOperations.cs | 12 +- .../src/Generated/VpnConnectionsOperations.cs | 12 +- .../src/Generated/VpnGatewaysOperations.cs | 18 +- .../Generated/VpnLinkConnectionsOperations.cs | 6 +- ...tionsAssociatedWithVirtualWanOperations.cs | 2 +- .../VpnServerConfigurationsOperations.cs | 12 +- .../VpnSiteLinkConnectionsOperations.cs | 2 +- .../src/Generated/VpnSiteLinksOperations.cs | 4 +- .../VpnSitesConfigurationOperations.cs | 2 +- .../src/Generated/VpnSitesOperations.cs | 12 +- ...ebApplicationFirewallPoliciesOperations.cs | 10 +- .../src/Generated/WebCategoriesOperations.cs | 4 +- .../Microsoft.Azure.Management.Network.csproj | 2 +- .../src/Properties/AssemblyInfo.cs | 2 +- 275 files changed, 26086 insertions(+), 2291 deletions(-) create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveConnectivityConfigurationsOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveConnectivityConfigurationsOperationsExtensions.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityAdminRulesOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityAdminRulesOperationsExtensions.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityUserRulesOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityUserRulesOperationsExtensions.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperationsExtensions.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperationsExtensions.cs rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/{VirtualNetworkGatewayNatRulesOperations.cs => ConnectivityConfigurationsOperations.cs} (81%) create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperationsExtensions.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveConnectivityConfigurationsOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveConnectivityConfigurationsOperationsExtensions.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveVirtualNetworksOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveVirtualNetworksOperationsExtensions.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveConnectivityConfigurationsOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityAdminRulesOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityUserRulesOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRuleCollectionsOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRulesOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IConnectivityConfigurationsOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IEffectiveConnectivityConfigurationsOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IEffectiveVirtualNetworksOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkGroupsOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerCommitsOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerDeploymentStatusOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerEffectiveSecurityAdminRulesOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagersOperations.cs rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/{IVirtualNetworkGatewayNatRulesOperations.cs => INetworkSecurityPerimetersOperations.cs} (58%) create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPerimeterAssociableResourceTypesOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityAdminConfigurationsOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityUserConfigurationsOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IUserRuleCollectionsOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IUserRulesOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityAdminRule.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityUserRule.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConfigurationParameter.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfiguration.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfigurationsListResult.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityAdminRule.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityUserRule.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRule.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRulesListResult.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRule.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRulesListResult.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AddressPrefixItem.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AddressPrefixType.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AdminRule.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseAdminRule.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseUserRule.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationGroup.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationType.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityConfiguration.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityGroupItem.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityTopology.cs rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{GatewayLoadBalancerTunnelInterfaceType.cs => CreatedByType.cs} (61%) create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultAdminRule.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultUserRule.cs rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{BastionHostSkuName.cs => DeleteExistingNSGs.cs} (71%) create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteExistingPeering.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeploymentStatus.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveBaseSecurityAdminRule.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveConnectivityConfiguration.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveDefaultSecurityAdminRule.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveSecurityAdminRule.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetwork.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksListResult.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksParameter.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelInterface.cs rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{GatewayLoadBalancerTunnelProtocol.cs => GroupConnectivity.cs} (70%) rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{Sku.cs => GroupMembersItem.cs} (60%) create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Hub.cs rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{SyncRemoteAddressSpace.cs => IsGlobal.cs} (74%) delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequest.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequestFrontendIPConfiguration.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MembershipType.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroup.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroupsCreateOrUpdateHeaders.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManager.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerCommit.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatus.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusListResult.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusParameter.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveConnectivityConfigurationListResult.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveSecurityAdminRulesListResult.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerPropertiesNetworkManagerScopes.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerSecurityGroupItem.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkSecurityPerimeter.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PerimeterAssociableResource.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PerimeterAssociableResourcesListResult.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ProxyResource.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/QueryRequestOptions.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/RuleCollection.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfiguration.cs rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{PreferredRoutingGateway.cs => SecurityConfigurationRuleAccess.cs} (63%) create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleDirection.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleProtocol.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityType.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SystemData.cs rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{DeleteOptions.cs => UseHubGateway.cs} (72%) create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UserRule.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayNatRule.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeeringLevel.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperationsExtensions.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperationsExtensions.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerDeploymentStatusOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerDeploymentStatusOperationsExtensions.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerEffectiveSecurityAdminRulesOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerEffectiveSecurityAdminRulesOperationsExtensions.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperationsExtensions.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperationsExtensions.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperationsExtensions.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperationsExtensions.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityUserConfigurationsOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityUserConfigurationsOperationsExtensions.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRuleCollectionsOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRuleCollectionsOperationsExtensions.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRulesOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRulesOperationsExtensions.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperationsExtensions.cs diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveConnectivityConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveConnectivityConfigurationsOperations.cs new file mode 100644 index 000000000000..1697e158f3ee --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveConnectivityConfigurationsOperations.cs @@ -0,0 +1,262 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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; + + /// + /// ActiveConnectivityConfigurationsOperations operations. + /// + internal partial class ActiveConnectivityConfigurationsOperations : IServiceOperations, IActiveConnectivityConfigurationsOperations + { + /// + /// Initializes a new instance of the ActiveConnectivityConfigurationsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ActiveConnectivityConfigurationsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Lists active connectivity configurations in a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.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(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _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); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveConnectivityConfigurationsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveConnectivityConfigurationsOperationsExtensions.cs new file mode 100644 index 000000000000..91b9e2648a5a --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveConnectivityConfigurationsOperationsExtensions.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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ActiveConnectivityConfigurationsOperations. + /// + public static partial class ActiveConnectivityConfigurationsOperationsExtensions + { + /// + /// 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. + /// + /// + /// Active Configuration Parameter. + /// + public static ActiveConnectivityConfigurationsListResult List(this IActiveConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, object parameters) + { + return operations.ListAsync(resourceGroupName, networkManagerName, parameters).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. + /// + /// + /// Active Configuration Parameter. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this IActiveConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, object parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityAdminRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityAdminRulesOperations.cs new file mode 100644 index 000000000000..d8fddcce5e64 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityAdminRulesOperations.cs @@ -0,0 +1,262 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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; + + /// + /// ActiveSecurityAdminRulesOperations operations. + /// + internal partial class ActiveSecurityAdminRulesOperations : IServiceOperations, IActiveSecurityAdminRulesOperations + { + /// + /// Initializes a new instance of the ActiveSecurityAdminRulesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ActiveSecurityAdminRulesOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Lists active security admin rules in a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.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(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _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); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityAdminRulesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityAdminRulesOperationsExtensions.cs new file mode 100644 index 000000000000..75cb43b89d03 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityAdminRulesOperationsExtensions.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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ActiveSecurityAdminRulesOperations. + /// + public static partial class ActiveSecurityAdminRulesOperationsExtensions + { + /// + /// 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. + /// + /// + /// Active Configuration Parameter. + /// + public static ActiveSecurityAdminRulesListResult List(this IActiveSecurityAdminRulesOperations operations, string resourceGroupName, string networkManagerName, object parameters) + { + return operations.ListAsync(resourceGroupName, networkManagerName, parameters).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. + /// + /// + /// Active Configuration Parameter. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this IActiveSecurityAdminRulesOperations operations, string resourceGroupName, string networkManagerName, object parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityUserRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityUserRulesOperations.cs new file mode 100644 index 000000000000..1c3dbeccddbe --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityUserRulesOperations.cs @@ -0,0 +1,262 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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; + + /// + /// ActiveSecurityUserRulesOperations operations. + /// + internal partial class ActiveSecurityUserRulesOperations : IServiceOperations, IActiveSecurityUserRulesOperations + { + /// + /// Initializes a new instance of the ActiveSecurityUserRulesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ActiveSecurityUserRulesOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Lists Active Security User Rules in a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listActiveSecurityUserRules").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _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); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityUserRulesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityUserRulesOperationsExtensions.cs new file mode 100644 index 000000000000..6c41e9f405aa --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityUserRulesOperationsExtensions.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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ActiveSecurityUserRulesOperations. + /// + public static partial class ActiveSecurityUserRulesOperationsExtensions + { + /// + /// Lists Active Security User Rules in a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Active Configuration Parameter. + /// + public static ActiveSecurityUserRulesListResult List(this IActiveSecurityUserRulesOperations operations, string resourceGroupName, string networkManagerName, object parameters) + { + return operations.ListAsync(resourceGroupName, networkManagerName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Lists Active Security User Rules in a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Active Configuration Parameter. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this IActiveSecurityUserRulesOperations operations, string resourceGroupName, string networkManagerName, object parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperations.cs new file mode 100644 index 000000000000..ff6043978c5e --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperations.cs @@ -0,0 +1,1107 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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 + { + /// + /// Initializes a new instance of the AdminRuleCollectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal AdminRuleCollectionsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Lists all the rule collections in a security admin configuration, in a + /// paginated format. + /// + /// + /// 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new 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); + } + // Construct URL + var _baseUrl = 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("{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 (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('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a network manager security admin configuration rule collection. + /// + /// + /// 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new 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); + } + // Construct URL + var _baseUrl = 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("{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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + 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. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The name of the network manager security Configuration rule collection. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(RuleCollection ruleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (ruleCollection == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollection"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("ruleCollection", ruleCollection); + 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, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = 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("{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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _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); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes an admin rule collection. + /// + /// + /// 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. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new 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, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = 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("{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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _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); + } + return _result; + } + + /// + /// Lists all the rule collections in a security admin configuration, in a + /// paginated format. + /// + /// + /// The NextLink from the previous successful call to List 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperationsExtensions.cs new file mode 100644 index 000000000000..01e9248b091b --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperationsExtensions.cs @@ -0,0 +1,288 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// 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; + } + } + + /// + /// 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 RuleCollection Get(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName) + { + return 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)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// 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 RuleCollection CreateOrUpdate(this IAdminRuleCollectionsOperations operations, RuleCollection ruleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName) + { + return operations.CreateOrUpdateAsync(ruleCollection, resourceGroupName, networkManagerName, configurationName, ruleCollectionName).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, RuleCollection ruleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(ruleCollection, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, null, cancellationToken).ConfigureAwait(false)) + { + 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. + /// + public static void Delete(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName) + { + operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName).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. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// 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/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperations.cs new file mode 100644 index 000000000000..22224af60f72 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperations.cs @@ -0,0 +1,1141 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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 + { + /// + /// Initializes a new instance of the AdminRulesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal AdminRulesOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// List all network manager security configuration admin rules. + /// + /// + /// 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("ruleCollectionName", ruleCollectionName); + tracingParameters.Add("top", top); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = 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("{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 (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('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a network manager security configuration admin rule. + /// + /// + /// 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + if (ruleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new 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); + } + // Construct URL + var _baseUrl = 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("{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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + 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. + /// + /// + /// 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (adminRule == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "adminRule"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + if (ruleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("adminRule", adminRule); + 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, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = 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("{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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _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); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes an admin rule. + /// + /// + /// 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. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + if (ruleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new 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, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = 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("{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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _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); + } + return _result; + } + + /// + /// List all network manager security configuration admin rules. + /// + /// + /// The NextLink from the previous successful call to List 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperationsExtensions.cs new file mode 100644 index 000000000000..beb48f173673 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperationsExtensions.cs @@ -0,0 +1,308 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// 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; + } + } + + /// + /// 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 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)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// 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) + { + return operations.CreateOrUpdateAsync(adminRule, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName).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)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(adminRule, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, null, cancellationToken).ConfigureAwait(false)) + { + 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. + /// + public static void Delete(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName) + { + operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName).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. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// 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/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateEndpointConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateEndpointConnectionsOperations.cs index 9231b2695aa9..5eb5c1c1b475 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateEndpointConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateEndpointConnectionsOperations.cs @@ -155,7 +155,7 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +549,7 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -738,11 +738,15 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateLinkResourcesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateLinkResourcesOperations.cs index d91fd38afd31..c468b3b247a5 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateLinkResourcesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateLinkResourcesOperations.cs @@ -94,7 +94,7 @@ internal ApplicationGatewayPrivateLinkResourcesOperations(NetworkManagementClien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewaysOperations.cs index 6b3c07439940..368c80ade2f8 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewaysOperations.cs @@ -116,7 +116,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -342,7 +342,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -536,7 +536,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -714,7 +714,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -991,7 +991,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1162,7 +1162,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1333,7 +1333,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1504,7 +1504,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1680,7 +1680,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1856,7 +1856,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2039,7 +2039,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "predefinedPolicyName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2228,7 +2228,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2415,7 +2415,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2631,7 +2631,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2804,7 +2804,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2985,7 +2985,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3196,7 +3196,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "probeRequest"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationSecurityGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationSecurityGroupsOperations.cs index ce389fc9c292..2454b8a63c24 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationSecurityGroupsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationSecurityGroupsOperations.cs @@ -116,7 +116,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -343,7 +343,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -530,7 +530,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -713,7 +713,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -902,7 +902,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1086,7 +1086,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableDelegationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableDelegationsOperations.cs index 8fa5ebfb12cd..abdee37b7ca8 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableDelegationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableDelegationsOperations.cs @@ -88,7 +88,7 @@ internal AvailableDelegationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableEndpointServicesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableEndpointServicesOperations.cs index fc745bd1d505..a4c8d494e1dc 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableEndpointServicesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableEndpointServicesOperations.cs @@ -87,7 +87,7 @@ internal AvailableEndpointServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailablePrivateEndpointTypesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailablePrivateEndpointTypesOperations.cs index f75b8657c46c..c35ff7911f3a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailablePrivateEndpointTypesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailablePrivateEndpointTypesOperations.cs @@ -88,7 +88,7 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -281,7 +281,7 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableResourceGroupDelegationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableResourceGroupDelegationsOperations.cs index 4b41933a1330..c219d401c918 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableResourceGroupDelegationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableResourceGroupDelegationsOperations.cs @@ -95,7 +95,7 @@ internal AvailableResourceGroupDelegationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableServiceAliasesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableServiceAliasesOperations.cs index 93837be87e9e..fc50ac4b85ee 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableServiceAliasesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableServiceAliasesOperations.cs @@ -87,7 +87,7 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -279,7 +279,7 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallFqdnTagsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallFqdnTagsOperations.cs index 6c7a50e030fd..cbcb59123504 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallFqdnTagsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallFqdnTagsOperations.cs @@ -80,7 +80,7 @@ internal AzureFirewallFqdnTagsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallsOperations.cs index a928b7c36eeb..cc7eaada128f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallsOperations.cs @@ -116,7 +116,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -353,7 +353,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -531,7 +531,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -718,7 +718,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -912,7 +912,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1138,7 +1138,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BastionHostsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BastionHostsOperations.cs index 103a014964f7..a78b59c78039 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BastionHostsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BastionHostsOperations.cs @@ -116,7 +116,7 @@ internal BastionHostsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -321,7 +321,7 @@ internal BastionHostsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -504,7 +504,7 @@ internal BastionHostsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -693,7 +693,7 @@ internal BastionHostsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -876,7 +876,7 @@ internal BastionHostsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BgpServiceCommunitiesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BgpServiceCommunitiesOperations.cs index 14c42a5366c2..b1fe12548e98 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BgpServiceCommunitiesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BgpServiceCommunitiesOperations.cs @@ -80,7 +80,7 @@ internal BgpServiceCommunitiesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectionMonitorsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectionMonitorsOperations.cs index f2a831709c5b..572bde4a13c5 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectionMonitorsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectionMonitorsOperations.cs @@ -133,7 +133,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -363,7 +363,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -636,7 +636,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -847,7 +847,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1072,7 +1072,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1249,7 +1249,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1426,7 +1426,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1606,7 +1606,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperations.cs similarity index 81% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperations.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperations.cs index 805b9943c103..08b672546e7d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.Network using System.Threading.Tasks; /// - /// VirtualNetworkGatewayNatRulesOperations operations. + /// ConnectivityConfigurationsOperations operations. /// - internal partial class VirtualNetworkGatewayNatRulesOperations : IServiceOperations, IVirtualNetworkGatewayNatRulesOperations + internal partial class ConnectivityConfigurationsOperations : IServiceOperations, IConnectivityConfigurationsOperations { /// - /// Initializes a new instance of the VirtualNetworkGatewayNatRulesOperations class. + /// Initializes a new instance of the ConnectivityConfigurationsOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class VirtualNetworkGatewayNatRulesOperations : IServiceOperati /// /// Thrown when a required parameter is null /// - internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) + internal ConnectivityConfigurationsOperations(NetworkManagementClient client) { if (client == null) { @@ -51,16 +51,17 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// Retrieves the details of a nat rule. + /// Gets a Network Connectivity Configuration, specified by the resource group, + /// network manager name, and connectivity Configuration name /// /// - /// The resource group name of the Virtual Network Gateway. + /// The name of the resource group. /// - /// - /// The name of the gateway. + /// + /// The name of the network manager. /// - /// - /// The name of the nat rule. + /// + /// The name of the network manager connectivity configuration. /// /// /// Headers that will be added to request. @@ -83,7 +84,7 @@ 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 Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -93,15 +94,15 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (virtualNetworkGatewayName == null) + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); } - if (natRuleName == null) + if (configurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2021-02-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -109,20 +110,20 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("natRuleName", natRuleName); 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); } // Construct URL var _baseUrl = 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(); + 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{natRuleName}", System.Uri.EscapeDataString(natRuleName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -221,7 +222,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -234,7 +235,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -254,67 +255,20 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) } /// - /// Creates a nat rule to a scalable virtual network gateway if it doesn't - /// exist else updates the existing nat rules. + /// Creates/Updates a new network manager connectivity configuration /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. + /// + /// Parameters supplied to create/update a network manager connectivity + /// configuration /// - /// - /// Parameters supplied to create or Update a Nat Rule. - /// - /// - /// The 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)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes a nat rule. - /// /// - /// The resource group name of the Virtual Network Gateway. + /// The name of the resource group. /// - /// - /// The name of the gateway. + /// + /// The name of the network manager. /// - /// - /// The name of the nat rule. - /// - /// - /// The 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)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves all nat rules for a particular virtual network gateway. - /// - /// - /// The resource group name of the virtual network gateway. - /// - /// - /// The name of the gateway. + /// + /// The name of the network manager connectivity configuration. /// /// /// Headers that will be added to request. @@ -337,8 +291,16 @@ 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 Task> CreateOrUpdateWithHttpMessagesAsync(ConnectivityConfiguration connectivityConfiguration, string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (connectivityConfiguration == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "connectivityConfiguration"); + } + if (connectivityConfiguration != null) + { + connectivityConfiguration.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -347,11 +309,15 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (virtualNetworkGatewayName == null) + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2021-02-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -359,18 +325,21 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); + tracingParameters.Add("connectivityConfiguration", connectivityConfiguration); tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByVirtualNetworkGateway", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = 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(); + 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -383,7 +352,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -414,6 +383,12 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) // 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); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -434,7 +409,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -469,7 +444,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -482,7 +457,25 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -502,20 +495,17 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) } /// - /// Creates a nat rule to a scalable virtual network gateway if it doesn't - /// exist else updates the existing nat rules. + /// Deletes a network manager connectivity configuration, specified by the + /// resource group, network manager name, and connectivity configuration name /// /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. + /// The name of the resource group. /// - /// - /// The name of the nat rule. + /// + /// The name of the network manager. /// - /// - /// Parameters supplied to create or Update a Nat Rule. + /// + /// The name of the network manager connectivity configuration. /// /// /// Headers that will be added to request. @@ -526,9 +516,6 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -538,7 +525,7 @@ 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 Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -548,19 +535,15 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (virtualNetworkGatewayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); - } - if (natRuleName == null) + if (networkManagerName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); } - if (natRuleParameters == null) + if (configurationName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "natRuleParameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2021-02-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -568,21 +551,20 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("natRuleName", natRuleName); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("natRuleParameters", natRuleParameters); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = 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(); + 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{natRuleName}", System.Uri.EscapeDataString(natRuleName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -595,7 +577,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -626,12 +608,6 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) // 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); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -652,7 +628,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -687,49 +663,13 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -738,16 +678,24 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) } /// - /// Deletes a nat rule. + /// Lists all the network manager connectivity configuration in a specified + /// network manager. /// /// - /// The resource group name of the Virtual Network Gateway. + /// The name of the resource group. /// - /// - /// The name of the gateway. + /// + /// The name of the network manager. /// - /// - /// The name of the nat rule. + /// + /// 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. /// /// /// Headers that will be added to request. @@ -758,6 +706,9 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -767,7 +718,7 @@ 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 Task>> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -777,15 +728,19 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (virtualNetworkGatewayName == null) + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (top > 20) { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); } - if (natRuleName == null) + if (top < 1) { - throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); } - string apiVersion = "2021-02-01"; + string apiVersion = "2021-02-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -793,25 +748,33 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); - tracingParameters.Add("natRuleName", natRuleName); 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, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = 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(); + 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); - _url = _url.Replace("{natRuleName}", System.Uri.EscapeDataString(natRuleName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); List _queryParameters = new 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('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -819,7 +782,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -870,7 +833,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -905,13 +868,31 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -920,7 +901,8 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) } /// - /// Retrieves all nat rules for a particular virtual network gateway. + /// Lists all the network manager connectivity configuration in a specified + /// network manager. /// /// /// The NextLink from the previous successful call to List operation. @@ -946,7 +928,7 @@ 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 Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -961,7 +943,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByVirtualNetworkGatewayNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -1060,7 +1042,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1073,7 +1055,7 @@ internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperationsExtensions.cs new file mode 100644 index 000000000000..4985d5567c8e --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperationsExtensions.cs @@ -0,0 +1,270 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// 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; + } + } + + /// + /// 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) + { + return operations.CreateOrUpdateAsync(connectivityConfiguration, 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. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IConnectivityConfigurationsOperations operations, ConnectivityConfiguration connectivityConfiguration, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(connectivityConfiguration, resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)) + { + 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. + /// + public static void Delete(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName) + { + operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName).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. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// 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)) + { + return operations.ListAsync(resourceGroupName, networkManagerName, top, skipToken).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)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// 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/sdk/network/Microsoft.Azure.Management.Network/src/Generated/CustomIPPrefixesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/CustomIPPrefixesOperations.cs index 03392f411211..1ba7a0b4636d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/CustomIPPrefixesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/CustomIPPrefixesOperations.cs @@ -119,7 +119,7 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -720,7 +720,7 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1088,11 +1088,15 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosCustomPoliciesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosCustomPoliciesOperations.cs index 9356d78ad2e9..ccad956f2296 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosCustomPoliciesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosCustomPoliciesOperations.cs @@ -116,7 +116,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -342,7 +342,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -540,7 +540,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -723,7 +723,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosProtectionPlansOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosProtectionPlansOperations.cs index be558b5ab53f..8effd010c864 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosProtectionPlansOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosProtectionPlansOperations.cs @@ -116,7 +116,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -342,7 +342,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -529,7 +529,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -712,7 +712,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -901,7 +901,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1084,7 +1084,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DefaultSecurityRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DefaultSecurityRulesOperations.cs index f1a2dc4fbc4f..7a44c31c1201 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DefaultSecurityRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DefaultSecurityRulesOperations.cs @@ -94,7 +94,7 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DscpConfigurationOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DscpConfigurationOperations.cs index 9873b6613755..042b8c3cf635 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DscpConfigurationOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DscpConfigurationOperations.cs @@ -141,7 +141,7 @@ internal DscpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -328,7 +328,7 @@ internal DscpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -506,7 +506,7 @@ internal DscpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -703,7 +703,7 @@ internal DscpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -919,7 +919,7 @@ internal DscpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveConnectivityConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveConnectivityConfigurationsOperations.cs new file mode 100644 index 000000000000..67f5629af998 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveConnectivityConfigurationsOperations.cs @@ -0,0 +1,263 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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; + + /// + /// EffectiveConnectivityConfigurationsOperations operations. + /// + internal partial class EffectiveConnectivityConfigurationsOperations : IServiceOperations, IEffectiveConnectivityConfigurationsOperations + { + /// + /// Initializes a new instance of the EffectiveConnectivityConfigurationsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal EffectiveConnectivityConfigurationsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// List all effective connectivity configurations applied on a virtual + /// network. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (virtualNetworkName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("virtualNetworkName", virtualNetworkName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.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(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _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); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveConnectivityConfigurationsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveConnectivityConfigurationsOperationsExtensions.cs new file mode 100644 index 000000000000..8e0d53955d1e --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveConnectivityConfigurationsOperationsExtensions.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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for EffectiveConnectivityConfigurationsOperations. + /// + public static partial class EffectiveConnectivityConfigurationsOperationsExtensions + { + /// + /// 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. + /// + /// + /// Parameters supplied to list correct page. + /// + public static NetworkManagerEffectiveConnectivityConfigurationListResult List(this IEffectiveConnectivityConfigurationsOperations operations, string resourceGroupName, string virtualNetworkName, object parameters) + { + return operations.ListAsync(resourceGroupName, virtualNetworkName, parameters).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. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this IEffectiveConnectivityConfigurationsOperations operations, string resourceGroupName, string virtualNetworkName, object parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveVirtualNetworksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveVirtualNetworksOperations.cs new file mode 100644 index 000000000000..9648703b89ad --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveVirtualNetworksOperations.cs @@ -0,0 +1,507 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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; + + /// + /// EffectiveVirtualNetworksOperations operations. + /// + internal partial class EffectiveVirtualNetworksOperations : IServiceOperations, IEffectiveVirtualNetworksOperations + { + /// + /// Initializes a new instance of the EffectiveVirtualNetworksOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal EffectiveVirtualNetworksOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// List effective virtual networks in a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Effective Virtual Networks Parameter. + /// + /// + /// 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListByNetworkManagerWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, EffectiveVirtualNetworksParameter parameters, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("top", top); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByNetworkManager", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listEffectiveVirtualNetworks").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new 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('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _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); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all effective virtual networks by specified network group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListByNetworkGroupWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, QueryRequestOptions parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (networkGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkGroupName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("networkGroupName", networkGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByNetworkGroup", tracingParameters); + } + // Construct URL + var _baseUrl = 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}/listEffectiveVirtualNetworks").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _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); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveVirtualNetworksOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveVirtualNetworksOperationsExtensions.cs new file mode 100644 index 000000000000..14446653d772 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveVirtualNetworksOperationsExtensions.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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for EffectiveVirtualNetworksOperations. + /// + public static partial class EffectiveVirtualNetworksOperationsExtensions + { + /// + /// List effective virtual networks in a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Effective Virtual Networks Parameter. + /// + /// + /// 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 EffectiveVirtualNetworksListResult ListByNetworkManager(this IEffectiveVirtualNetworksOperations operations, string resourceGroupName, string networkManagerName, EffectiveVirtualNetworksParameter parameters, int? top = default(int?), string skipToken = default(string)) + { + return operations.ListByNetworkManagerAsync(resourceGroupName, networkManagerName, parameters, top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// List effective virtual networks in a network manager. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Effective Virtual Networks Parameter. + /// + /// + /// 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 ListByNetworkManagerAsync(this IEffectiveVirtualNetworksOperations operations, string resourceGroupName, string networkManagerName, EffectiveVirtualNetworksParameter parameters, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByNetworkManagerWithHttpMessagesAsync(resourceGroupName, networkManagerName, parameters, top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists all effective virtual networks by 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 to get. + /// + /// + /// Parameters supplied to list correct page. + /// + public static EffectiveVirtualNetworksListResult ListByNetworkGroup(this IEffectiveVirtualNetworksOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, QueryRequestOptions parameters) + { + return operations.ListByNetworkGroupAsync(resourceGroupName, networkManagerName, networkGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Lists all effective virtual networks by 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 to get. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// The cancellation token. + /// + public static async Task ListByNetworkGroupAsync(this IEffectiveVirtualNetworksOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, QueryRequestOptions parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByNetworkGroupWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitAuthorizationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitAuthorizationsOperations.cs index dad64a32f76d..727b5f00e5fc 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitAuthorizationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitAuthorizationsOperations.cs @@ -127,7 +127,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -352,7 +352,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -551,7 +551,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -744,7 +744,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitConnectionsOperations.cs index e1e87c7ce4f9..8fd1e24b67e6 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitConnectionsOperations.cs @@ -138,7 +138,7 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -377,7 +377,7 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -585,7 +585,7 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -788,7 +788,7 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitPeeringsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitPeeringsOperations.cs index 122b85ca4492..65618c5c3a84 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitPeeringsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitPeeringsOperations.cs @@ -126,7 +126,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +549,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -746,7 +746,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitsOperations.cs index c806cddcaef5..3ec95cf70b5d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitsOperations.cs @@ -116,7 +116,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -343,7 +343,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -631,7 +631,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -832,7 +832,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1021,7 +1021,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1199,7 +1199,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1386,7 +1386,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1570,7 +1570,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1804,7 +1804,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2017,7 +2017,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2230,7 +2230,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteConnectionsOperations.cs index 25e7889593a3..3ea85853d7dd 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteConnectionsOperations.cs @@ -130,7 +130,7 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -564,7 +564,7 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -789,7 +789,7 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs index 5131c2b7d228..424a65d5311d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs @@ -94,7 +94,7 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -320,7 +320,7 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +549,7 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -746,7 +746,7 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionsOperations.cs index 5a6a435b2d59..3e954d5166fe 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionsOperations.cs @@ -80,7 +80,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -263,7 +263,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -455,7 +455,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -681,7 +681,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -976,7 +976,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1192,7 +1192,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1405,7 +1405,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1618,7 +1618,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteGatewaysOperations.cs index 2f86ea48dfc7..537dedbce767 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteGatewaysOperations.cs @@ -80,7 +80,7 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -263,7 +263,7 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -505,7 +505,7 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -734,7 +734,7 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -960,7 +960,7 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "expressRouteGatewayParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1160,7 +1160,7 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteLinksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteLinksOperations.cs index 6aeeda12d144..1f1298dc0741 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteLinksOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteLinksOperations.cs @@ -101,7 +101,7 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "linkName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -298,7 +298,7 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsLocationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsLocationsOperations.cs index 6b3321f4b107..1c89b656f426 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsLocationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsLocationsOperations.cs @@ -82,7 +82,7 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -266,7 +266,7 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "locationName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsOperations.cs index 5ffc81a47db4..787248fedffc 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsOperations.cs @@ -116,7 +116,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -342,7 +342,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -536,7 +536,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -714,7 +714,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -916,7 +916,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { request.Validate(); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1114,7 +1114,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1297,7 +1297,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteServiceProvidersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteServiceProvidersOperations.cs index 0a204582f11a..5fa49ce548c5 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteServiceProvidersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteServiceProvidersOperations.cs @@ -80,7 +80,7 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPoliciesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPoliciesOperations.cs index c6751fefe998..d0653512977d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPoliciesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPoliciesOperations.cs @@ -119,7 +119,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -336,7 +336,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -514,7 +514,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -701,7 +701,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -884,7 +884,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyRuleCollectionGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyRuleCollectionGroupsOperations.cs index 18f24674b839..cf21a38eb076 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyRuleCollectionGroupsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyRuleCollectionGroupsOperations.cs @@ -126,7 +126,7 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +549,7 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -746,7 +746,7 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FlowLogsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FlowLogsOperations.cs index 8dd83d5554c4..7cb8a17e5295 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FlowLogsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FlowLogsOperations.cs @@ -136,7 +136,7 @@ internal FlowLogsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -341,7 +341,7 @@ internal FlowLogsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -557,7 +557,7 @@ internal FlowLogsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -764,7 +764,7 @@ internal FlowLogsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -984,7 +984,7 @@ internal FlowLogsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubRouteTablesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubRouteTablesOperations.cs index 83c9b20f1056..908cdbecf80a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubRouteTablesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubRouteTablesOperations.cs @@ -130,7 +130,7 @@ internal HubRouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal HubRouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,7 +560,7 @@ internal HubRouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -785,7 +785,7 @@ internal HubRouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubVirtualNetworkConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubVirtualNetworkConnectionsOperations.cs index 3285c9afc8ef..e004b4b0ce74 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubVirtualNetworkConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubVirtualNetworkConnectionsOperations.cs @@ -155,7 +155,7 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,7 +560,7 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "hubVirtualNetworkConnectionParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -785,7 +785,7 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveConnectivityConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveConnectivityConfigurationsOperations.cs new file mode 100644 index 000000000000..359b182a5d4d --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveConnectivityConfigurationsOperations.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ActiveConnectivityConfigurationsOperations operations. + /// + public partial interface IActiveConnectivityConfigurationsOperations + { + /// + /// Lists active connectivity configurations in a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Active Configuration Parameter. + /// + /// + /// 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(string resourceGroupName, string networkManagerName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityAdminRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityAdminRulesOperations.cs new file mode 100644 index 000000000000..f335a3886261 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityAdminRulesOperations.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ActiveSecurityAdminRulesOperations operations. + /// + public partial interface IActiveSecurityAdminRulesOperations + { + /// + /// Lists active security admin rules in a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Active Configuration Parameter. + /// + /// + /// 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(string resourceGroupName, string networkManagerName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityUserRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityUserRulesOperations.cs new file mode 100644 index 000000000000..da30dc26eb9c --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityUserRulesOperations.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ActiveSecurityUserRulesOperations operations. + /// + public partial interface IActiveSecurityUserRulesOperations + { + /// + /// Lists Active Security User Rules in a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Active Configuration Parameter. + /// + /// + /// 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(string resourceGroupName, string networkManagerName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRuleCollectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRuleCollectionsOperations.cs new file mode 100644 index 000000000000..860ac9b22b48 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRuleCollectionsOperations.cs @@ -0,0 +1,186 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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. + /// + public partial interface IAdminRuleCollectionsOperations + { + /// + /// Lists all the rule collections in a security admin configuration, + /// in a paginated format. + /// + /// + /// 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 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(string resourceGroupName, string networkManagerName, string configurationName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a network manager security admin configuration rule + /// collection. + /// + /// + /// 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 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> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates an admin rule collection. + /// + /// + /// 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 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> CreateOrUpdateWithHttpMessagesAsync(RuleCollection ruleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes an admin rule collection. + /// + /// + /// 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 headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the rule collections in a security admin configuration, + /// in a paginated format. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRulesOperations.cs new file mode 100644 index 000000000000..5b4c575a6a0d --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRulesOperations.cs @@ -0,0 +1,196 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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. + /// + public partial interface IAdminRulesOperations + { + /// + /// List all network manager security configuration admin rules. + /// + /// + /// 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 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(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a network manager security configuration admin rule. + /// + /// + /// 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 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> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates an admin rule. + /// + /// + /// 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 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> CreateOrUpdateWithHttpMessagesAsync(BaseAdminRule adminRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes an admin rule. + /// + /// + /// 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 headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all network manager security configuration admin rules. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IConnectivityConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IConnectivityConfigurationsOperations.cs new file mode 100644 index 000000000000..238d0e1b8e7f --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IConnectivityConfigurationsOperations.cs @@ -0,0 +1,175 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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. + /// + public partial interface IConnectivityConfigurationsOperations + { + /// + /// Gets a Network Connectivity Configuration, specified by the + /// resource group, network manager name, and connectivity + /// Configuration name + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager connectivity configuration. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates/Updates a new network manager connectivity configuration + /// + /// + /// 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 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> CreateOrUpdateWithHttpMessagesAsync(ConnectivityConfiguration connectivityConfiguration, string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a network manager connectivity configuration, specified by + /// the resource group, network manager name, and connectivity + /// configuration name + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager connectivity configuration. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the network manager connectivity configuration in a + /// specified network manager. + /// + /// + /// 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 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(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the network manager connectivity configuration in a + /// specified network manager. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IEffectiveConnectivityConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IEffectiveConnectivityConfigurationsOperations.cs new file mode 100644 index 000000000000..05563dea56ff --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IEffectiveConnectivityConfigurationsOperations.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// EffectiveConnectivityConfigurationsOperations operations. + /// + public partial interface IEffectiveConnectivityConfigurationsOperations + { + /// + /// List all effective connectivity configurations applied on a virtual + /// network. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// 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(string resourceGroupName, string virtualNetworkName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IEffectiveVirtualNetworksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IEffectiveVirtualNetworksOperations.cs new file mode 100644 index 000000000000..be5ab18bf8d0 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IEffectiveVirtualNetworksOperations.cs @@ -0,0 +1,96 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// EffectiveVirtualNetworksOperations operations. + /// + public partial interface IEffectiveVirtualNetworksOperations + { + /// + /// List effective virtual networks in a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Effective Virtual Networks Parameter. + /// + /// + /// 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 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> ListByNetworkManagerWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, EffectiveVirtualNetworksParameter parameters, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all effective virtual networks by specified network group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// 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> ListByNetworkGroupWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, QueryRequestOptions parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ILoadBalancersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ILoadBalancersOperations.cs index 4c3e80785eb5..cdeff94f892d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ILoadBalancersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ILoadBalancersOperations.cs @@ -172,28 +172,6 @@ public partial interface ILoadBalancersOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Swaps VIPs between two load balancers. - /// - /// - /// The region where load balancers are located at. - /// - /// - /// Parameters that define which VIPs should be swapped. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// 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)); - /// /// Deletes the specified load balancer. /// /// @@ -245,28 +223,6 @@ public partial interface ILoadBalancersOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Swaps VIPs between two load balancers. - /// - /// - /// The region where load balancers are located at. - /// - /// - /// Parameters that define which VIPs should be swapped. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// 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)); - /// /// Gets all the load balancers in a subscription. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkGroupsOperations.cs new file mode 100644 index 000000000000..cfcf113ee4c4 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkGroupsOperations.cs @@ -0,0 +1,174 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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. + /// + public partial interface INetworkGroupsOperations + { + /// + /// Gets the specified network group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a network group. + /// + /// + /// 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 to get. + /// + /// + /// 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 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> CreateOrUpdateWithHttpMessagesAsync(NetworkGroup parameters, string resourceGroupName, string networkManagerName, string networkGroupName, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a network group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the specified network group. + /// + /// + /// 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 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(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the specified network group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagementClient.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagementClient.cs index 4345303d04c6..243c475cd8e8 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagementClient.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagementClient.cs @@ -300,6 +300,101 @@ public partial interface INetworkManagementClient : System.IDisposable /// INetworkInterfaceTapConfigurationsOperations NetworkInterfaceTapConfigurations { get; } + /// + /// Gets the INetworkManagersOperations. + /// + INetworkManagersOperations NetworkManagers { get; } + + /// + /// Gets the INetworkManagerCommitsOperations. + /// + INetworkManagerCommitsOperations NetworkManagerCommits { get; } + + /// + /// Gets the INetworkManagerDeploymentStatusOperations. + /// + INetworkManagerDeploymentStatusOperations NetworkManagerDeploymentStatus { get; } + + /// + /// Gets the IEffectiveVirtualNetworksOperations. + /// + IEffectiveVirtualNetworksOperations EffectiveVirtualNetworks { get; } + + /// + /// Gets the IActiveConnectivityConfigurationsOperations. + /// + IActiveConnectivityConfigurationsOperations ActiveConnectivityConfigurations { get; } + + /// + /// Gets the IActiveSecurityAdminRulesOperations. + /// + IActiveSecurityAdminRulesOperations ActiveSecurityAdminRules { get; } + + /// + /// Gets the IActiveSecurityUserRulesOperations. + /// + IActiveSecurityUserRulesOperations ActiveSecurityUserRules { get; } + + /// + /// Gets the IConnectivityConfigurationsOperations. + /// + IConnectivityConfigurationsOperations ConnectivityConfigurations { get; } + + /// + /// Gets the IEffectiveConnectivityConfigurationsOperations. + /// + IEffectiveConnectivityConfigurationsOperations EffectiveConnectivityConfigurations { get; } + + /// + /// Gets the INetworkManagerEffectiveSecurityAdminRulesOperations. + /// + INetworkManagerEffectiveSecurityAdminRulesOperations NetworkManagerEffectiveSecurityAdminRules { get; } + + /// + /// Gets the INetworkGroupsOperations. + /// + INetworkGroupsOperations NetworkGroups { get; } + + /// + /// Gets the ISecurityUserConfigurationsOperations. + /// + ISecurityUserConfigurationsOperations SecurityUserConfigurations { get; } + + /// + /// Gets the IUserRuleCollectionsOperations. + /// + IUserRuleCollectionsOperations UserRuleCollections { get; } + + /// + /// Gets the IUserRulesOperations. + /// + IUserRulesOperations UserRules { get; } + + /// + /// Gets the ISecurityAdminConfigurationsOperations. + /// + ISecurityAdminConfigurationsOperations SecurityAdminConfigurations { get; } + + /// + /// Gets the IAdminRuleCollectionsOperations. + /// + IAdminRuleCollectionsOperations AdminRuleCollections { get; } + + /// + /// Gets the IAdminRulesOperations. + /// + IAdminRulesOperations AdminRules { get; } + + /// + /// Gets the INetworkSecurityPerimetersOperations. + /// + INetworkSecurityPerimetersOperations NetworkSecurityPerimeters { get; } + + /// + /// Gets the IPerimeterAssociableResourceTypesOperations. + /// + IPerimeterAssociableResourceTypesOperations PerimeterAssociableResourceTypes { get; } + /// /// Gets the INetworkProfilesOperations. /// @@ -480,11 +575,6 @@ public partial interface INetworkManagementClient : System.IDisposable /// ILocalNetworkGatewaysOperations LocalNetworkGateways { get; } - /// - /// Gets the IVirtualNetworkGatewayNatRulesOperations. - /// - IVirtualNetworkGatewayNatRulesOperations VirtualNetworkGatewayNatRules { get; } - /// /// Gets the IVirtualNetworkTapsOperations. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerCommitsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerCommitsOperations.cs new file mode 100644 index 000000000000..98c04c5684ec --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerCommitsOperations.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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. + /// + public partial interface INetworkManagerCommitsOperations + { + /// + /// 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. + /// + /// + /// 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> PostWithHttpMessagesAsync(NetworkManagerCommit parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerDeploymentStatusOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerDeploymentStatusOperations.cs new file mode 100644 index 000000000000..a88ee70040aa --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerDeploymentStatusOperations.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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. + /// + public partial interface INetworkManagerDeploymentStatusOperations + { + /// + /// Post to List of Network Manager Deployment Status. + /// + /// + /// Parameters supplied to specify which Managed Network deployment + /// status is. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// 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(NetworkManagerDeploymentStatusParameter parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerEffectiveSecurityAdminRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerEffectiveSecurityAdminRulesOperations.cs new file mode 100644 index 000000000000..5e957d43d159 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerEffectiveSecurityAdminRulesOperations.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// NetworkManagerEffectiveSecurityAdminRulesOperations operations. + /// + public partial interface INetworkManagerEffectiveSecurityAdminRulesOperations + { + /// + /// List all effective security admin rules applied on a virtual + /// network. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// 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(string resourceGroupName, string virtualNetworkName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagersOperations.cs new file mode 100644 index 000000000000..df3c60f9c203 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagersOperations.cs @@ -0,0 +1,235 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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. + /// + public partial interface INetworkManagersOperations + { + /// + /// Gets the specified Network Manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(NetworkManager parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Patch a NetworkManager Tags. + /// + /// + /// Parameters supplied to update network manager tags. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// 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> PatchTagsWithHttpMessagesAsync(TagsObject parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all network managers in a subscription. + /// + /// + /// 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 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(int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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. + /// + /// + /// 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. + /// + /// + /// The cancellation 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, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all network managers in a subscription. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List network managers in a resource group. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkGatewayNatRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkSecurityPerimetersOperations.cs similarity index 58% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkGatewayNatRulesOperations.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkSecurityPerimetersOperations.cs index cfe04ed49e72..c9aca3bb444e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkGatewayNatRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkSecurityPerimetersOperations.cs @@ -19,21 +19,18 @@ namespace Microsoft.Azure.Management.Network using System.Threading.Tasks; /// - /// VirtualNetworkGatewayNatRulesOperations operations. + /// NetworkSecurityPerimetersOperations operations. /// - public partial interface IVirtualNetworkGatewayNatRulesOperations + public partial interface INetworkSecurityPerimetersOperations { /// - /// Retrieves the details of a nat rule. + /// Gets the specified network security perimeter by the name. /// /// - /// The resource group name of the Virtual Network Gateway. + /// The name of the resource group. /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. + /// + /// The name of the network security perimeter. /// /// /// The headers that will be added to request. @@ -50,22 +47,19 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityPerimeterName, Dictionary> customHeaders = null, 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. + /// Creates or updates a Network Security Perimeter. /// - /// - /// The resource group name of the Virtual Network Gateway. + /// + /// Parameter supplied to create or update the network security + /// perimeter. /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. + /// + /// The name of the resource group. /// - /// - /// Parameters supplied to create or Update a Nat Rule. + /// + /// The name of the network security perimeter. /// /// /// The headers that will be added to request. @@ -82,18 +76,15 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(NetworkSecurityPerimeter parameters, string resourceGroupName, string networkSecurityPerimeterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a nat rule. + /// Deletes a network security perimeter. /// /// - /// The resource group name of the Virtual Network Gateway. + /// The name of the resource group. /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. + /// + /// The name of the network security perimeter. /// /// /// The headers that will be added to request. @@ -107,15 +98,19 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityPerimeterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Retrieves all nat rules for a particular virtual network gateway. + /// List all network security perimeters in a subscription. /// - /// - /// The resource group name of the virtual network gateway. + /// + /// An optional query parameter which specifies the maximum number of + /// records to be returned by the server. /// - /// - /// The name of the gateway. + /// + /// 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,22 +127,22 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Thrown when a required parameter is null /// - Task>> ListByVirtualNetworkGatewayWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListBySubscriptionWithHttpMessagesAsync(int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, 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. + /// List network security perimeters in a resource group. /// /// - /// The resource group name of the Virtual Network Gateway. + /// The name of the resource group. /// - /// - /// The name of the gateway. + /// + /// An optional query parameter which specifies the maximum number of + /// records to be returned by the server. /// - /// - /// The name of the nat rule. - /// - /// - /// Parameters supplied to create or Update a Nat Rule. + /// + /// 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. @@ -164,18 +159,12 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a nat rule. + /// List all network security perimeters in a subscription. /// - /// - /// The resource group name of the Virtual Network Gateway. - /// - /// - /// The name of the gateway. - /// - /// - /// The name of the nat rule. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -186,12 +175,15 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Retrieves all nat rules for a particular virtual network gateway. + /// List network security perimeters in a resource group. /// /// /// The NextLink from the previous successful call to List operation. @@ -211,6 +203,6 @@ public partial interface IVirtualNetworkGatewayNatRulesOperations /// /// Thrown when a required parameter is null /// - Task>> ListByVirtualNetworkGatewayNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPerimeterAssociableResourceTypesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPerimeterAssociableResourceTypesOperations.cs new file mode 100644 index 000000000000..65d326f86a25 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPerimeterAssociableResourceTypesOperations.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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// PerimeterAssociableResourceTypesOperations operations. + /// + public partial interface IPerimeterAssociableResourceTypesOperations + { + /// + /// Gets the list of resources that are onboarded with NSP. These + /// resources can be associated with a network security perimeter + /// + /// + /// The location of the where the association is present. + /// + /// + /// 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> GetWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityAdminConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityAdminConfigurationsOperations.cs new file mode 100644 index 000000000000..7d3ac606c48c --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityAdminConfigurationsOperations.cs @@ -0,0 +1,170 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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. + /// + public partial interface ISecurityAdminConfigurationsOperations + { + /// + /// Lists all the network manager security admin configurations in a + /// network manager, in a paginated format. + /// + /// + /// 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 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(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves a network manager security admin configuration. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a network manager security admin configuration. + /// + /// + /// 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 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> CreateOrUpdateWithHttpMessagesAsync(SecurityConfiguration securityAdminConfiguration, string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a network manager security admin configuration. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// 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. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityUserConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityUserConfigurationsOperations.cs new file mode 100644 index 000000000000..1d2445133ddc --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityUserConfigurationsOperations.cs @@ -0,0 +1,170 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SecurityUserConfigurationsOperations operations. + /// + public partial interface ISecurityUserConfigurationsOperations + { + /// + /// Lists all the network manager security user configurations in a + /// network manager, in a paginated format. + /// + /// + /// 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 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(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves a network manager security user configuration. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a network manager security user configuration. + /// + /// + /// The security user 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 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> CreateOrUpdateWithHttpMessagesAsync(SecurityConfiguration securityUserConfiguration, string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a network manager security user configuration. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the network manager security user configurations in a + /// network manager, in a paginated format. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IUserRuleCollectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IUserRuleCollectionsOperations.cs new file mode 100644 index 000000000000..9013ffe428b7 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IUserRuleCollectionsOperations.cs @@ -0,0 +1,185 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// UserRuleCollectionsOperations operations. + /// + public partial interface IUserRuleCollectionsOperations + { + /// + /// Lists all the user rule collections in a security configuration, in + /// a paginated format. + /// + /// + /// 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 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(string resourceGroupName, string networkManagerName, string configurationName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a network manager security user configuration rule collection. + /// + /// + /// 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 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> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a user rule collection. + /// + /// + /// The User 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 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> CreateOrUpdateWithHttpMessagesAsync(RuleCollection userRuleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a user rule collection. + /// + /// + /// 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 headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the user rule collections in a security configuration, in + /// a paginated format. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IUserRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IUserRulesOperations.cs new file mode 100644 index 000000000000..ae01bd107ac5 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IUserRulesOperations.cs @@ -0,0 +1,196 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// UserRulesOperations operations. + /// + public partial interface IUserRulesOperations + { + /// + /// Lists all user rules in a rule collection. + /// + /// + /// 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 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(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a user rule. + /// + /// + /// 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 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> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a user rule. + /// + /// + /// The user 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 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> CreateOrUpdateWithHttpMessagesAsync(BaseUserRule userRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a user rule. + /// + /// + /// 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 headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all user rules in a rule collection. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkPeeringsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkPeeringsOperations.cs index 7d4f2c17d1c0..30d8cf856f60 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkPeeringsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkPeeringsOperations.cs @@ -92,11 +92,6 @@ public partial interface IVirtualNetworkPeeringsOperations /// 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. /// @@ -112,7 +107,7 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// 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)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all virtual network peerings in a virtual network. /// @@ -179,11 +174,6 @@ public partial interface IVirtualNetworkPeeringsOperations /// 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. /// @@ -199,7 +189,7 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// 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)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all virtual network peerings in a virtual network. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundNatRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundNatRulesOperations.cs index bb2fa1fa176a..af63e984b55e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundNatRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundNatRulesOperations.cs @@ -94,7 +94,7 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -323,7 +323,7 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -556,7 +556,7 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -744,11 +744,15 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "inboundNatRuleParameters"); } + if (inboundNatRuleParameters != null) + { + inboundNatRuleParameters.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundSecurityRuleOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundSecurityRuleOperations.cs index 71359f43d975..c11fc6f5f661 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundSecurityRuleOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundSecurityRuleOperations.cs @@ -140,7 +140,7 @@ internal InboundSecurityRuleOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpAllocationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpAllocationsOperations.cs index 83c3bed9e92e..03bf9f74963b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpAllocationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpAllocationsOperations.cs @@ -119,7 +119,7 @@ internal IpAllocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal IpAllocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal IpAllocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -720,7 +720,7 @@ internal IpAllocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal IpAllocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1092,7 +1092,7 @@ internal IpAllocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpGroupsOperations.cs index 05df39419e92..97f7c7a2feb1 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpGroupsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpGroupsOperations.cs @@ -98,7 +98,7 @@ internal IpGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -324,7 +324,7 @@ internal IpGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -535,7 +535,7 @@ internal IpGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -708,7 +708,7 @@ internal IpGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -900,7 +900,7 @@ internal IpGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1111,7 +1111,7 @@ internal IpGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerBackendAddressPoolsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerBackendAddressPoolsOperations.cs index 53144ece0d39..929e3bd3aa1c 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerBackendAddressPoolsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerBackendAddressPoolsOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,7 +560,7 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -785,7 +785,7 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs index 7d4ffb0dcc69..d68664f3bb76 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerLoadBalancingRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerLoadBalancingRulesOperations.cs index ebe3076b390c..4f7b1bf8ad33 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerLoadBalancingRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerLoadBalancingRulesOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerNetworkInterfacesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerNetworkInterfacesOperations.cs index d2aa818ebc98..c318f6963400 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerNetworkInterfacesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerNetworkInterfacesOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerNetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerOutboundRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerOutboundRulesOperations.cs index be952c47a179..a0bf8e787632 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerOutboundRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerOutboundRulesOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerProbesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerProbesOperations.cs index 881fb8037971..00c1cd53433c 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerProbesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerProbesOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperations.cs index 82cee7df715b..ba393202a49b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperations.cs @@ -119,7 +119,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -720,7 +720,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -868,28 +868,6 @@ internal LoadBalancersOperations(NetworkManagementClient client) return _result; } - /// - /// Swaps VIPs between two load balancers. - /// - /// - /// The region where load balancers are located at. - /// - /// - /// Parameters that define which VIPs should be swapped. - /// - /// - /// The 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)) - { - // Send request - AzureOperationResponse _response = await BeginSwapPublicIpAddressesWithHttpMessagesAsync(location, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - /// /// Deletes the specified load balancer. /// @@ -931,7 +909,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1110,11 +1088,15 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1289,184 +1271,6 @@ internal LoadBalancersOperations(NetworkManagementClient client) return _result; } - /// - /// Swaps VIPs between two load balancers. - /// - /// - /// The region where load balancers are located at. - /// - /// - /// Parameters that define which VIPs should be swapped. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// 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 BeginSwapPublicIpAddressesWithHttpMessagesAsync(string location, LoadBalancerVipSwapRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2021-02-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("location", location); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginSwapPublicIpAddresses", tracingParameters); - } - // Construct URL - var _baseUrl = 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(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _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); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - 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)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _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); - } - return _result; - } - /// /// Gets all the load balancers in a subscription. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperationsExtensions.cs index 362dbdb0106b..9477a9b9d806 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperationsExtensions.cs @@ -258,43 +258,6 @@ public static IPage List(this ILoadBalancersOperations operations, } } - /// - /// 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(); - } - /// /// Deletes the specified load balancer. /// @@ -378,43 +341,6 @@ public static LoadBalancer BeginCreateOrUpdate(this ILoadBalancersOperations ope } } - /// - /// 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(); - } - /// /// Gets all the load balancers in a subscription. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LocalNetworkGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LocalNetworkGatewaysOperations.cs index a30a76866a18..2ef11e9f2f7b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LocalNetworkGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LocalNetworkGatewaysOperations.cs @@ -127,7 +127,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -357,7 +357,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -551,7 +551,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -762,7 +762,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -985,7 +985,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityAdminRule.cs new file mode 100644 index 000000000000..d08982310a28 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityAdminRule.cs @@ -0,0 +1,124 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Network base admin rule. + /// + public partial class ActiveBaseSecurityAdminRule + { + /// + /// Initializes a new instance of the ActiveBaseSecurityAdminRule + /// class. + /// + public ActiveBaseSecurityAdminRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ActiveBaseSecurityAdminRule + /// class. + /// + /// Resource ID. + /// Deployment time string. + /// Deployment region. + /// A display name of the + /// security admin configuration. + /// A description of the + /// security admin configuration. + /// A display name of the rule + /// collection. + /// 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 configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList)) + { + Id = id; + CommitTime = commitTime; + Region = region; + ConfigurationDisplayName = configurationDisplayName; + ConfigurationDescription = configurationDescription; + RuleCollectionDisplayName = ruleCollectionDisplayName; + RuleCollectionDescription = ruleCollectionDescription; + RuleCollectionAppliesToGroups = ruleCollectionAppliesToGroups; + RuleGroups = ruleGroups; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets deployment time string. + /// + [JsonProperty(PropertyName = "commitTime")] + public System.DateTime? CommitTime { get; set; } + + /// + /// Gets or sets deployment region. + /// + [JsonProperty(PropertyName = "region")] + public string Region { get; set; } + + /// + /// Gets or sets a display name of the security admin configuration. + /// + [JsonProperty(PropertyName = "configurationDisplayName")] + public string ConfigurationDisplayName { get; set; } + + /// + /// Gets or sets a description of the security admin configuration. + /// + [JsonProperty(PropertyName = "configurationDescription")] + public string ConfigurationDescription { get; set; } + + /// + /// Gets or sets a display name of the rule collection. + /// + [JsonProperty(PropertyName = "ruleCollectionDisplayName")] + public string RuleCollectionDisplayName { get; set; } + + /// + /// Gets or sets a description of the rule collection. + /// + [JsonProperty(PropertyName = "ruleCollectionDescription")] + public string RuleCollectionDescription { get; set; } + + /// + /// Gets or sets groups for rule collection + /// + [JsonProperty(PropertyName = "ruleCollectionAppliesToGroups")] + public IList RuleCollectionAppliesToGroups { get; set; } + + /// + /// Gets or sets effective configuration groups. + /// + [JsonProperty(PropertyName = "ruleGroups")] + public IList RuleGroups { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityUserRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityUserRule.cs new file mode 100644 index 000000000000..aae11068350f --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityUserRule.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 Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Network base rule. + /// + public partial class ActiveBaseSecurityUserRule + { + /// + /// Initializes a new instance of the ActiveBaseSecurityUserRule class. + /// + public ActiveBaseSecurityUserRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ActiveBaseSecurityUserRule class. + /// + /// Resource ID. + /// Deployment time string. + /// Deployment region. + /// A display name of the + /// security user configuration. + /// A description of the + /// security user configuration. + /// A display name of the rule + /// collection. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + public ActiveBaseSecurityUserRule(string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList)) + { + Id = id; + CommitTime = commitTime; + Region = region; + ConfigurationDisplayName = configurationDisplayName; + ConfigurationDescription = configurationDescription; + RuleCollectionDisplayName = ruleCollectionDisplayName; + RuleCollectionDescription = ruleCollectionDescription; + RuleCollectionAppliesToGroups = ruleCollectionAppliesToGroups; + RuleGroups = ruleGroups; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets deployment time string. + /// + [JsonProperty(PropertyName = "commitTime")] + public System.DateTime? CommitTime { get; set; } + + /// + /// Gets or sets deployment region. + /// + [JsonProperty(PropertyName = "region")] + public string Region { get; set; } + + /// + /// Gets or sets a display name of the security user configuration. + /// + [JsonProperty(PropertyName = "configurationDisplayName")] + public string ConfigurationDisplayName { get; set; } + + /// + /// Gets or sets a description of the security user configuration. + /// + [JsonProperty(PropertyName = "configurationDescription")] + public string ConfigurationDescription { get; set; } + + /// + /// Gets or sets a display name of the rule collection. + /// + [JsonProperty(PropertyName = "ruleCollectionDisplayName")] + public string RuleCollectionDisplayName { get; set; } + + /// + /// Gets or sets a description of the rule collection. + /// + [JsonProperty(PropertyName = "ruleCollectionDescription")] + public string RuleCollectionDescription { get; set; } + + /// + /// Gets or sets groups for rule collection + /// + [JsonProperty(PropertyName = "ruleCollectionAppliesToGroups")] + public IList RuleCollectionAppliesToGroups { get; set; } + + /// + /// Gets or sets effective configuration groups. + /// + [JsonProperty(PropertyName = "ruleGroups")] + public IList RuleGroups { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConfigurationParameter.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConfigurationParameter.cs new file mode 100644 index 000000000000..1769e86f2518 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConfigurationParameter.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Effective Virtual Networks Parameter. + /// + public partial class ActiveConfigurationParameter + { + /// + /// Initializes a new instance of the ActiveConfigurationParameter + /// class. + /// + public ActiveConfigurationParameter() + { + CustomInit(); + } + + /// + /// 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)) + { + Regions = regions; + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of regions. + /// + [JsonProperty(PropertyName = "regions")] + public 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. + /// + [JsonProperty(PropertyName = "skipToken")] + public string SkipToken { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfiguration.cs new file mode 100644 index 000000000000..3a32c446a152 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfiguration.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 Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Active connectivity configuration. + /// + public partial class ActiveConnectivityConfiguration : EffectiveConnectivityConfiguration + { + /// + /// Initializes a new instance of the ActiveConnectivityConfiguration + /// class. + /// + public ActiveConnectivityConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ActiveConnectivityConfiguration + /// class. + /// + /// Connectivity topology type. + /// Possible values include: 'HubAndSpoke', 'Mesh' + /// Resource ID. + /// A friendly name for the resource. + /// A description of the connectivity + /// configuration. + /// 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' + /// Effective configuration + /// groups. + /// Deployment time string. + /// Deployment region. + public ActiveConnectivityConfiguration(string connectivityTopology, string id = default(string), string displayName = default(string), string description = default(string), IList hubs = default(IList), string isGlobal = default(string), IList appliesToGroups = default(IList), string provisioningState = default(string), string deleteExistingPeering = default(string), IList configurationGroups = default(IList), System.DateTime? commitTime = default(System.DateTime?), string region = default(string)) + : base(connectivityTopology, id, displayName, description, hubs, isGlobal, appliesToGroups, provisioningState, deleteExistingPeering, configurationGroups) + { + CommitTime = commitTime; + Region = region; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets deployment time string. + /// + [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(); + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfigurationsListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfigurationsListResult.cs new file mode 100644 index 000000000000..a6c9ddbd693b --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfigurationsListResult.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 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. + /// + public partial class ActiveConnectivityConfigurationsListResult + { + /// + /// Initializes a new instance of the + /// ActiveConnectivityConfigurationsListResult class. + /// + public ActiveConnectivityConfigurationsListResult() + { + CustomInit(); + } + + /// + /// 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)) + { + Value = value; + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a page of active connectivity configurations. + /// + [JsonProperty(PropertyName = "value")] + public 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. + /// + [JsonProperty(PropertyName = "skipToken")] + public string SkipToken { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityAdminRule.cs new file mode 100644 index 000000000000..c3aafcd2dfe2 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityAdminRule.cs @@ -0,0 +1,183 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 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] + public partial class ActiveDefaultSecurityAdminRule : ActiveBaseSecurityAdminRule + { + /// + /// Initializes a new instance of the ActiveDefaultSecurityAdminRule + /// class. + /// + public ActiveDefaultSecurityAdminRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ActiveDefaultSecurityAdminRule + /// class. + /// + /// Resource ID. + /// Deployment time string. + /// Deployment region. + /// A display name of the + /// security admin configuration. + /// A description of the + /// security admin configuration. + /// A display name of the rule + /// collection. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + /// A friendly name for the rule. + /// 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' + public ActiveDefaultSecurityAdminRule(string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string displayName = default(string), 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)) + : base(id, commitTime, region, configurationDisplayName, configurationDescription, ruleCollectionDisplayName, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) + { + DisplayName = displayName; + Description = description; + Flag = flag; + Protocol = protocol; + Sources = sources; + Destinations = destinations; + SourcePortRanges = sourcePortRanges; + DestinationPortRanges = destinationPortRanges; + Access = access; + Priority = priority; + Direction = direction; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a friendly name for the rule. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets a description for this rule. Restricted to 140 chars. + /// + [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; } + + /// + /// 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; } + + /// + /// Gets the CIDR or source IP ranges. + /// + [JsonProperty(PropertyName = "properties.sources")] + public IList Sources { get; private set; } + + /// + /// Gets the destination address prefixes. CIDR or destination IP + /// ranges. + /// + [JsonProperty(PropertyName = "properties.destinations")] + public IList Destinations { get; private set; } + + /// + /// Gets the source port ranges. + /// + [JsonProperty(PropertyName = "properties.sourcePortRanges")] + public 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; } + + /// + /// 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; } + + /// + /// 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; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityUserRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityUserRule.cs new file mode 100644 index 000000000000..3d6b60ab2c19 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityUserRule.cs @@ -0,0 +1,160 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Network security default user rule. + /// + [Newtonsoft.Json.JsonObject("Default")] + [Rest.Serialization.JsonTransformation] + public partial class ActiveDefaultSecurityUserRule : ActiveBaseSecurityUserRule + { + /// + /// Initializes a new instance of the ActiveDefaultSecurityUserRule + /// class. + /// + public ActiveDefaultSecurityUserRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ActiveDefaultSecurityUserRule + /// class. + /// + /// Resource ID. + /// Deployment time string. + /// Deployment region. + /// A display name of the + /// security user configuration. + /// A description of the + /// security user configuration. + /// A display name of the rule + /// collection. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + /// A friendly name for the rule. + /// 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 if the traffic matched against + /// the rule in inbound or outbound. Possible values include: + /// 'Inbound', 'Outbound' + /// The provisioning state of the + /// security configuration user rule resource. Possible values include: + /// 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ActiveDefaultSecurityUserRule(string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string displayName = default(string), 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 direction = default(string), string provisioningState = default(string)) + : base(id, commitTime, region, configurationDisplayName, configurationDescription, ruleCollectionDisplayName, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) + { + DisplayName = displayName; + Description = description; + Flag = flag; + Protocol = protocol; + Sources = sources; + Destinations = destinations; + SourcePortRanges = sourcePortRanges; + DestinationPortRanges = destinationPortRanges; + Direction = direction; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a friendly name for the rule. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets a description for this rule. Restricted to 140 chars. + /// + [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; } + + /// + /// 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; } + + /// + /// Gets the CIDR or source IP ranges. + /// + [JsonProperty(PropertyName = "properties.sources")] + public IList Sources { get; private set; } + + /// + /// Gets the destination address prefixes. CIDR or destination IP + /// ranges. + /// + [JsonProperty(PropertyName = "properties.destinations")] + public IList Destinations { get; private set; } + + /// + /// Gets the source port ranges. + /// + [JsonProperty(PropertyName = "properties.sourcePortRanges")] + public IList SourcePortRanges { get; private set; } + + /// + /// Gets the destination port ranges. + /// + [JsonProperty(PropertyName = "properties.destinationPortRanges")] + public IList DestinationPortRanges { get; private set; } + + /// + /// 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 security configuration user rule + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRule.cs new file mode 100644 index 000000000000..17c1eb47ef76 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRule.cs @@ -0,0 +1,203 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 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] + public partial class ActiveSecurityAdminRule : ActiveBaseSecurityAdminRule + { + /// + /// Initializes a new instance of the ActiveSecurityAdminRule class. + /// + public ActiveSecurityAdminRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ActiveSecurityAdminRule class. + /// + /// 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' + /// 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 display name of the + /// security admin configuration. + /// A description of the + /// security admin configuration. + /// A display name of the rule + /// collection. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + /// A friendly name for the rule. + /// 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 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. + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + public ActiveSecurityAdminRule(string protocol, string access, string direction, string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string displayName = default(string), string description = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), int? priority = default(int?), string provisioningState = default(string)) + : base(id, commitTime, region, configurationDisplayName, configurationDescription, ruleCollectionDisplayName, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) + { + DisplayName = displayName; + Description = description; + Protocol = protocol; + Sources = sources; + Destinations = destinations; + SourcePortRanges = sourcePortRanges; + DestinationPortRanges = destinationPortRanges; + Access = access; + Priority = priority; + Direction = direction; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a friendly name for the rule. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// 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', 'Any', 'Ah' + /// + [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; } + + /// + /// Gets or sets the destination address prefixes. CIDR or destination + /// IP ranges. + /// + [JsonProperty(PropertyName = "properties.destinations")] + public IList Destinations { get; set; } + + /// + /// Gets or sets the source port ranges. + /// + [JsonProperty(PropertyName = "properties.sourcePortRanges")] + public IList SourcePortRanges { get; set; } + + /// + /// Gets or sets the destination port ranges. + /// + [JsonProperty(PropertyName = "properties.destinationPortRanges")] + public IList DestinationPortRanges { get; set; } + + /// + /// 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; } + + /// + /// 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; } + + /// + /// 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; } + + /// + /// 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) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 1); + } + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRulesListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRulesListResult.cs new file mode 100644 index 000000000000..343d36d55c0c --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRulesListResult.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 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. + /// + public partial class ActiveSecurityAdminRulesListResult + { + /// + /// Initializes a new instance of the + /// ActiveSecurityAdminRulesListResult class. + /// + public ActiveSecurityAdminRulesListResult() + { + CustomInit(); + } + + /// + /// 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)) + { + Value = value; + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a page of active security admin rules. + /// + [JsonProperty(PropertyName = "value")] + public 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. + /// + [JsonProperty(PropertyName = "skipToken")] + public string SkipToken { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRule.cs new file mode 100644 index 000000000000..c13c74801328 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRule.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 Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Network security user rule. + /// + [Newtonsoft.Json.JsonObject("Custom")] + [Rest.Serialization.JsonTransformation] + public partial class ActiveSecurityUserRule : ActiveBaseSecurityUserRule + { + /// + /// Initializes a new instance of the ActiveSecurityUserRule class. + /// + public ActiveSecurityUserRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ActiveSecurityUserRule class. + /// + /// Network protocol this rule applies to. + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', + /// 'Ah' + /// 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 display name of the + /// security user configuration. + /// A description of the + /// security user configuration. + /// A display name of the rule + /// collection. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + /// A friendly name for the rule. + /// A description for this rule. + /// 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 + /// security configuration user rule resource. Possible values include: + /// 'Succeeded', 'Updating', 'Deleting', 'Failed' + public ActiveSecurityUserRule(string protocol, string direction, string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string displayName = default(string), string description = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), string provisioningState = default(string)) + : base(id, commitTime, region, configurationDisplayName, configurationDescription, ruleCollectionDisplayName, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) + { + DisplayName = displayName; + Description = description; + Protocol = protocol; + Sources = sources; + Destinations = destinations; + SourcePortRanges = sourcePortRanges; + DestinationPortRanges = destinationPortRanges; + Direction = direction; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a friendly name for the rule. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets a description for this rule. + /// + [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' + /// + [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; } + + /// + /// Gets or sets the destination address prefixes. CIDR or destination + /// IP ranges. + /// + [JsonProperty(PropertyName = "properties.destinations")] + public IList Destinations { get; set; } + + /// + /// Gets or sets the source port ranges. + /// + [JsonProperty(PropertyName = "properties.sourcePortRanges")] + public IList SourcePortRanges { get; set; } + + /// + /// Gets or sets the destination port ranges. + /// + [JsonProperty(PropertyName = "properties.destinationPortRanges")] + public IList DestinationPortRanges { get; set; } + + /// + /// 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 security configuration user rule + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Protocol == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); + } + if (Direction == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Direction"); + } + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRulesListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRulesListResult.cs new file mode 100644 index 000000000000..1674025d5062 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRulesListResult.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 Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Result of the request to list active security user rules. It contains a + /// list of active security user rules and a skiptoken to get the next set + /// of results. + /// + public partial class ActiveSecurityUserRulesListResult + { + /// + /// Initializes a new instance of the ActiveSecurityUserRulesListResult + /// class. + /// + public ActiveSecurityUserRulesListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ActiveSecurityUserRulesListResult + /// class. + /// + /// Gets a page of active security user + /// 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 ActiveSecurityUserRulesListResult(IList value = default(IList), string skipToken = default(string)) + { + Value = value; + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a page of active security user rules. + /// + [JsonProperty(PropertyName = "value")] + public 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. + /// + [JsonProperty(PropertyName = "skipToken")] + public string SkipToken { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AddressPrefixItem.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AddressPrefixItem.cs new file mode 100644 index 000000000000..1874f1867c22 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AddressPrefixItem.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 Newtonsoft.Json; + using System.Linq; + + /// + /// Address prefix item. + /// + public partial class AddressPrefixItem + { + /// + /// Initializes a new instance of the AddressPrefixItem class. + /// + public AddressPrefixItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AddressPrefixItem class. + /// + /// Address prefix. + /// Address prefix type. Possible + /// values include: 'IPPrefix', 'ServiceTag' + public AddressPrefixItem(string addressPrefix = default(string), string addressPrefixType = default(string)) + { + AddressPrefix = addressPrefix; + AddressPrefixType = addressPrefixType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets address prefix. + /// + [JsonProperty(PropertyName = "addressPrefix")] + public string AddressPrefix { get; set; } + + /// + /// Gets or sets address prefix type. Possible values include: + /// 'IPPrefix', 'ServiceTag' + /// + [JsonProperty(PropertyName = "addressPrefixType")] + public string AddressPrefixType { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AddressPrefixType.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AddressPrefixType.cs new file mode 100644 index 000000000000..c094c49264ca --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AddressPrefixType.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 AddressPrefixType. + /// + public static class AddressPrefixType + { + public const string IPPrefix = "IPPrefix"; + public const string ServiceTag = "ServiceTag"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AdminRule.cs new file mode 100644 index 000000000000..767e9a566aff --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AdminRule.cs @@ -0,0 +1,196 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 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] + public partial class AdminRule : BaseAdminRule + { + /// + /// Initializes a new instance of the AdminRule class. + /// + public AdminRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AdminRule class. + /// + /// 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' + /// 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 friendly name for the rule. + /// 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 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. + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + public AdminRule(string protocol, string access, string direction, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string displayName = default(string), string description = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), int? priority = default(int?), string provisioningState = default(string)) + : base(id, name, type, etag, systemData) + { + DisplayName = displayName; + Description = description; + Protocol = protocol; + Sources = sources; + Destinations = destinations; + SourcePortRanges = sourcePortRanges; + DestinationPortRanges = destinationPortRanges; + Access = access; + Priority = priority; + Direction = direction; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a friendly name for the rule. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// 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', 'Any', 'Ah' + /// + [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; } + + /// + /// Gets or sets the destination address prefixes. CIDR or destination + /// IP ranges. + /// + [JsonProperty(PropertyName = "properties.destinations")] + public IList Destinations { get; set; } + + /// + /// Gets or sets the source port ranges. + /// + [JsonProperty(PropertyName = "properties.sourcePortRanges")] + public IList SourcePortRanges { get; set; } + + /// + /// Gets or sets the destination port ranges. + /// + [JsonProperty(PropertyName = "properties.destinationPortRanges")] + public IList DestinationPortRanges { get; set; } + + /// + /// 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; } + + /// + /// 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; } + + /// + /// 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; } + + /// + /// 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) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 1); + } + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGateway.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGateway.cs index 94a7a423c1fb..24bcc49fc4af 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGateway.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGateway.cs @@ -455,6 +455,16 @@ public virtual void Validate() { AutoscaleConfiguration.Validate(); } + if (PrivateEndpointConnections != null) + { + foreach (var element3 in PrivateEndpointConnections) + { + if (element3 != null) + { + element3.Validate(); + } + } + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs index f031eeef3a70..c2a9bdc553d5 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs @@ -75,6 +75,16 @@ public virtual void Validate() { BackendHttpSettings.Validate(); } + if (Servers != null) + { + foreach (var element in Servers) + { + if (element != null) + { + element.Validate(); + } + } + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthServer.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthServer.cs index 46b8ad150f46..2caf05181f53 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthServer.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthServer.cs @@ -76,5 +76,18 @@ public ApplicationGatewayBackendHealthServer() [JsonProperty(PropertyName = "healthProbeLog")] public string HealthProbeLog { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (IpConfiguration != null) + { + IpConfiguration.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayPrivateEndpointConnection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayPrivateEndpointConnection.cs index 4d0fe00919cd..83d8747fdb4a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayPrivateEndpointConnection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayPrivateEndpointConnection.cs @@ -115,5 +115,18 @@ public ApplicationGatewayPrivateEndpointConnection() [JsonProperty(PropertyName = "type")] public string Type { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PrivateEndpoint != null) + { + PrivateEndpoint.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayTrustedClientCertificate.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayTrustedClientCertificate.cs index 96ca38c8ca16..070e44985228 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayTrustedClientCertificate.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayTrustedClientCertificate.cs @@ -36,9 +36,6 @@ public ApplicationGatewayTrustedClientCertificate() /// /// 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' @@ -47,12 +44,10 @@ public ApplicationGatewayTrustedClientCertificate() /// 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)) + public ApplicationGatewayTrustedClientCertificate(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) { Data = data; - ValidatedCertData = validatedCertData; - ClientCertIssuerDN = clientCertIssuerDN; ProvisioningState = provisioningState; Name = name; Etag = etag; @@ -71,18 +66,6 @@ public ApplicationGatewayTrustedClientCertificate() [JsonProperty(PropertyName = "properties.data")] public string Data { get; set; } - /// - /// Gets validated certificate data. - /// - [JsonProperty(PropertyName = "properties.validatedCertData")] - public string ValidatedCertData { get; private set; } - - /// - /// Gets distinguished name of client certificate issuer. - /// - [JsonProperty(PropertyName = "properties.clientCertIssuerDN")] - public string ClientCertIssuerDN { get; private set; } - /// /// Gets the provisioning state of the trusted client certificate /// resource. Possible values include: 'Succeeded', 'Updating', diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BackendAddressPool.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BackendAddressPool.cs index 0cb46bba66e0..e944c6b349d3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BackendAddressPool.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BackendAddressPool.cs @@ -37,8 +37,6 @@ public BackendAddressPool() /// 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 @@ -58,11 +56,10 @@ public BackendAddressPool() /// 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), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) + public BackendAddressPool(string id = default(string), string location = default(string), IList loadBalancerBackendAddresses = default(IList), IList backendIPConfigurations = default(IList), IList loadBalancingRules = default(IList), SubResource outboundRule = default(SubResource), IList outboundRules = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) : base(id) { Location = location; - TunnelInterfaces = tunnelInterfaces; LoadBalancerBackendAddresses = loadBalancerBackendAddresses; BackendIPConfigurations = backendIPConfigurations; LoadBalancingRules = loadBalancingRules; @@ -86,12 +83,6 @@ public BackendAddressPool() [JsonProperty(PropertyName = "properties.location")] public string Location { get; set; } - /// - /// Gets or sets an array of gateway load balancer tunnel interfaces. - /// - [JsonProperty(PropertyName = "properties.tunnelInterfaces")] - public IList TunnelInterfaces { get; set; } - /// /// Gets or sets an array of backend addresses. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseAdminRule.cs new file mode 100644 index 000000000000..f756c6fdbc86 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseAdminRule.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 Newtonsoft.Json; + using System.Linq; + + /// + /// Network base admin rule. + /// + public partial class BaseAdminRule : ProxyResource + { + /// + /// Initializes a new instance of the BaseAdminRule class. + /// + public BaseAdminRule() + { + CustomInit(); + } + + /// + /// 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. + 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) + { + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the system metadata related to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseUserRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseUserRule.cs new file mode 100644 index 000000000000..981cfe80403a --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseUserRule.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 Newtonsoft.Json; + using System.Linq; + + /// + /// Network base rule. + /// + public partial class BaseUserRule : ProxyResource + { + /// + /// Initializes a new instance of the BaseUserRule class. + /// + public BaseUserRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BaseUserRule 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. + public BaseUserRule(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) + { + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the system metadata related to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHost.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHost.cs index 414ddeaa1860..120d516f0b78 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHost.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHost.cs @@ -48,15 +48,13 @@ public BastionHost() /// 'Updating', 'Deleting', 'Failed' /// 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), string provisioningState = default(string), string etag = default(string), Sku sku = default(Sku)) + 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), string provisioningState = default(string), string etag = default(string)) : base(id, name, type, location, tags) { IpConfigurations = ipConfigurations; DnsName = dnsName; ProvisioningState = provisioningState; Etag = etag; - Sku = sku; CustomInit(); } @@ -92,11 +90,5 @@ public BastionHost() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } - /// - /// Gets or sets the sku of this Bastion Host. - /// - [JsonProperty(PropertyName = "sku")] - public Sku Sku { get; set; } - } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationGroup.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationGroup.cs new file mode 100644 index 000000000000..a769893b45ec --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationGroup.cs @@ -0,0 +1,111 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The network configuration group resource + /// + [Rest.Serialization.JsonTransformation] + public partial class ConfigurationGroup + { + /// + /// Initializes a new instance of the ConfigurationGroup class. + /// + public ConfigurationGroup() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConfigurationGroup class. + /// + /// Resource ID. + /// A friendly name for the network + /// group. + /// A description of the network + /// group. + /// Group member type. + /// Group members of network group. + /// Network group conditional + /// filter. + /// The provisioning state of the scope + /// assignment resource. Possible values include: 'Succeeded', + /// 'Updating', 'Deleting', 'Failed' + public ConfigurationGroup(string id = default(string), string displayName = default(string), string description = default(string), string memberType = default(string), IList groupMembers = default(IList), string conditionalMembership = default(string), string provisioningState = default(string)) + { + Id = id; + DisplayName = displayName; + Description = description; + MemberType = memberType; + GroupMembers = groupMembers; + ConditionalMembership = conditionalMembership; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets a friendly name for the network group. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets a description of the network group. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets group member type. + /// + [JsonProperty(PropertyName = "properties.memberType")] + public string MemberType { get; set; } + + /// + /// Gets or sets group members of network group. + /// + [JsonProperty(PropertyName = "properties.groupMembers")] + public IList GroupMembers { get; set; } + + /// + /// Gets or sets network group conditional filter. + /// + [JsonProperty(PropertyName = "properties.conditionalMembership")] + public string ConditionalMembership { get; set; } + + /// + /// 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; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationType.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationType.cs new file mode 100644 index 000000000000..b98b4fb4e3a4 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationType.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 ConfigurationType. + /// + public static class ConfigurationType + { + public const string SecurityAdmin = "SecurityAdmin"; + public const string SecurityUser = "SecurityUser"; + public const string Connectivity = "Connectivity"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityConfiguration.cs new file mode 100644 index 000000000000..2a0075b8e63a --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityConfiguration.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 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] + public partial class ConnectivityConfiguration : ProxyResource + { + /// + /// Initializes a new instance of the ConnectivityConfiguration class. + /// + public ConnectivityConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConnectivityConfiguration class. + /// + /// Connectivity topology type. + /// Possible values include: 'HubAndSpoke', 'Mesh' + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + /// A friendly name for the resource. + /// A description of the connectivity + /// configuration. + /// 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' + /// The system metadata related to this + /// resource. + public ConnectivityConfiguration(string connectivityTopology, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string displayName = default(string), string description = default(string), IList hubs = default(IList), string isGlobal = default(string), IList appliesToGroups = default(IList), string provisioningState = default(string), string deleteExistingPeering = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, etag) + { + DisplayName = displayName; + Description = description; + ConnectivityTopology = connectivityTopology; + Hubs = hubs; + IsGlobal = isGlobal; + AppliesToGroups = appliesToGroups; + ProvisioningState = provisioningState; + DeleteExistingPeering = deleteExistingPeering; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a friendly name for the resource. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// 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' + /// + [JsonProperty(PropertyName = "properties.connectivityTopology")] + public string ConnectivityTopology { get; set; } + + /// + /// Gets or sets list of hubItems + /// + [JsonProperty(PropertyName = "properties.hubs")] + public IList Hubs { get; set; } + + /// + /// Gets or sets flag if global mesh is supported. Possible values + /// include: 'False', 'True' + /// + [JsonProperty(PropertyName = "properties.isGlobal")] + public string IsGlobal { get; set; } + + /// + /// Gets or sets groups for configuration + /// + [JsonProperty(PropertyName = "properties.appliesToGroups")] + public IList AppliesToGroups { get; set; } + + /// + /// Gets the provisioning state of the connectivity configuration + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets flag if need to remove current existing peerings. + /// Possible values include: 'False', 'True' + /// + [JsonProperty(PropertyName = "properties.deleteExistingPeering")] + public string DeleteExistingPeering { get; set; } + + /// + /// Gets the system metadata related to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ConnectivityTopology == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ConnectivityTopology"); + } + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityGroupItem.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityGroupItem.cs new file mode 100644 index 000000000000..e1f52c22535c --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityGroupItem.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 Newtonsoft.Json; + using System.Linq; + + public partial class ConnectivityGroupItem + { + /// + /// Initializes a new instance of the ConnectivityGroupItem class. + /// + public ConnectivityGroupItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConnectivityGroupItem class. + /// + /// 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' + /// Group connectivity type. Possible + /// values include: 'None', 'DirectlyConnected' + public ConnectivityGroupItem(string networkGroupId = default(string), string useHubGateway = default(string), string isGlobal = default(string), string groupConnectivity = default(string)) + { + NetworkGroupId = networkGroupId; + UseHubGateway = useHubGateway; + IsGlobal = isGlobal; + GroupConnectivity = groupConnectivity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets network group Id. + /// + [JsonProperty(PropertyName = "networkGroupId")] + public string NetworkGroupId { get; set; } + + /// + /// Gets or sets flag if need to use hub gateway. Possible values + /// include: 'False', 'True' + /// + [JsonProperty(PropertyName = "useHubGateway")] + public string UseHubGateway { get; set; } + + /// + /// Gets or sets flag if global is supported. Possible values include: + /// 'False', 'True' + /// + [JsonProperty(PropertyName = "isGlobal")] + public string IsGlobal { get; set; } + + /// + /// Gets or sets group connectivity type. Possible values include: + /// 'None', 'DirectlyConnected' + /// + [JsonProperty(PropertyName = "groupConnectivity")] + public string GroupConnectivity { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityTopology.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityTopology.cs new file mode 100644 index 000000000000..bc7499e64980 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityTopology.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 ConnectivityTopology. + /// + public static class ConnectivityTopology + { + public const string HubAndSpoke = "HubAndSpoke"; + public const string Mesh = "Mesh"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelInterfaceType.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CreatedByType.cs similarity index 61% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelInterfaceType.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CreatedByType.cs index 849a8b8eeb01..f360566a259f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelInterfaceType.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CreatedByType.cs @@ -12,12 +12,13 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for GatewayLoadBalancerTunnelInterfaceType. + /// Defines values for CreatedByType. /// - public static class GatewayLoadBalancerTunnelInterfaceType + public static class CreatedByType { - public const string None = "None"; - public const string Internal = "Internal"; - public const string External = "External"; + public const string User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CustomIpPrefix.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CustomIpPrefix.cs index 42337c4a1237..4be854e1b5a9 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CustomIpPrefix.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CustomIpPrefix.cs @@ -43,14 +43,6 @@ public CustomIpPrefix() /// IP prefix. /// 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', 'Commissioned', 'Decommissioning', @@ -59,8 +51,6 @@ public CustomIpPrefix() /// 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' @@ -68,19 +58,14 @@ public CustomIpPrefix() /// 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 cidr = default(string), string signedMessage = default(string), string authorizationMessage = default(string), CustomIpPrefix customIpPrefixParent = default(CustomIpPrefix), IList childCustomIpPrefixes = default(IList), string commissionedState = 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)) + 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 cidr = default(string), string commissionedState = default(string), IList publicIpPrefixes = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string), IList zones = default(IList)) : base(id, name, type, location, tags) { ExtendedLocation = extendedLocation; Cidr = cidr; - SignedMessage = signedMessage; - AuthorizationMessage = authorizationMessage; - CustomIpPrefixParent = customIpPrefixParent; - ChildCustomIpPrefixes = childCustomIpPrefixes; CommissionedState = commissionedState; PublicIpPrefixes = publicIpPrefixes; ResourceGuid = resourceGuid; - FailedReason = failedReason; ProvisioningState = provisioningState; Etag = etag; Zones = zones; @@ -105,30 +90,6 @@ public CustomIpPrefix() [JsonProperty(PropertyName = "properties.cidr")] public string Cidr { get; set; } - /// - /// Gets or sets signed message for WAN validation. - /// - [JsonProperty(PropertyName = "properties.signedMessage")] - public string SignedMessage { get; set; } - - /// - /// Gets or sets authorization message for WAN validation. - /// - [JsonProperty(PropertyName = "properties.authorizationMessage")] - public string AuthorizationMessage { get; set; } - - /// - /// Gets or sets the Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. - /// - [JsonProperty(PropertyName = "properties.customIpPrefixParent")] - public CustomIpPrefix CustomIpPrefixParent { get; set; } - - /// - /// Gets the list of all Children for IPv6 /48 CustomIpPrefix. - /// - [JsonProperty(PropertyName = "properties.childCustomIpPrefixes")] - public IList ChildCustomIpPrefixes { get; private set; } - /// /// Gets or sets the commissioned state of the Custom IP Prefix. /// Possible values include: 'Provisioning', 'Provisioned', @@ -150,12 +111,6 @@ public CustomIpPrefix() [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; private set; } - /// - /// Gets the reason why resource is in failed state. - /// - [JsonProperty(PropertyName = "properties.failedReason")] - public string FailedReason { get; private set; } - /// /// Gets the provisioning state of the custom IP prefix resource. /// Possible values include: 'Succeeded', 'Updating', 'Deleting', @@ -178,5 +133,18 @@ public CustomIpPrefix() [JsonProperty(PropertyName = "zones")] public IList Zones { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ExtendedLocation != null) + { + ExtendedLocation.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultAdminRule.cs new file mode 100644 index 000000000000..6dc262142654 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultAdminRule.cs @@ -0,0 +1,174 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 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] + public partial class DefaultAdminRule : BaseAdminRule + { + /// + /// Initializes a new instance of the DefaultAdminRule class. + /// + public DefaultAdminRule() + { + CustomInit(); + } + + /// + /// 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 friendly name for the rule. + /// 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' + public DefaultAdminRule(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string displayName = default(string), 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)) + : base(id, name, type, etag, systemData) + { + DisplayName = displayName; + Description = description; + Flag = flag; + Protocol = protocol; + Sources = sources; + Destinations = destinations; + SourcePortRanges = sourcePortRanges; + DestinationPortRanges = destinationPortRanges; + Access = access; + Priority = priority; + Direction = direction; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a friendly name for the rule. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets a description for this rule. Restricted to 140 chars. + /// + [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; } + + /// + /// 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; } + + /// + /// Gets the CIDR or source IP ranges. + /// + [JsonProperty(PropertyName = "properties.sources")] + public IList Sources { get; private set; } + + /// + /// Gets the destination address prefixes. CIDR or destination IP + /// ranges. + /// + [JsonProperty(PropertyName = "properties.destinations")] + public IList Destinations { get; private set; } + + /// + /// Gets the source port ranges. + /// + [JsonProperty(PropertyName = "properties.sourcePortRanges")] + public 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; } + + /// + /// 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; } + + /// + /// 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; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultUserRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultUserRule.cs new file mode 100644 index 000000000000..33e2654c5b61 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultUserRule.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 Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Network security default user rule. + /// + [Newtonsoft.Json.JsonObject("Default")] + [Rest.Serialization.JsonTransformation] + public partial class DefaultUserRule : BaseUserRule + { + /// + /// Initializes a new instance of the DefaultUserRule class. + /// + public DefaultUserRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DefaultUserRule 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 friendly name for the rule. + /// 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 if the traffic matched against + /// the rule in inbound or outbound. Possible values include: + /// 'Inbound', 'Outbound' + /// The provisioning state of the + /// security configuration user rule resource. Possible values include: + /// 'Succeeded', 'Updating', 'Deleting', 'Failed' + public DefaultUserRule(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string displayName = default(string), 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 direction = default(string), string provisioningState = default(string)) + : base(id, name, type, etag, systemData) + { + DisplayName = displayName; + Description = description; + Flag = flag; + Protocol = protocol; + Sources = sources; + Destinations = destinations; + SourcePortRanges = sourcePortRanges; + DestinationPortRanges = destinationPortRanges; + Direction = direction; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a friendly name for the rule. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets a description for this rule. Restricted to 140 chars. + /// + [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; } + + /// + /// 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; } + + /// + /// Gets the CIDR or source IP ranges. + /// + [JsonProperty(PropertyName = "properties.sources")] + public IList Sources { get; private set; } + + /// + /// Gets the destination address prefixes. CIDR or destination IP + /// ranges. + /// + [JsonProperty(PropertyName = "properties.destinations")] + public IList Destinations { get; private set; } + + /// + /// Gets the source port ranges. + /// + [JsonProperty(PropertyName = "properties.sourcePortRanges")] + public IList SourcePortRanges { get; private set; } + + /// + /// Gets the destination port ranges. + /// + [JsonProperty(PropertyName = "properties.destinationPortRanges")] + public IList DestinationPortRanges { get; private set; } + + /// + /// 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 security configuration user rule + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHostSkuName.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteExistingNSGs.cs similarity index 71% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHostSkuName.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteExistingNSGs.cs index a3dfc0fca92e..0b31c0657515 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHostSkuName.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteExistingNSGs.cs @@ -12,11 +12,11 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for BastionHostSkuName. + /// Defines values for DeleteExistingNSGs. /// - public static class BastionHostSkuName + public static class DeleteExistingNSGs { - public const string Basic = "Basic"; - public const string Standard = "Standard"; + public const string False = "False"; + public const string True = "True"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteExistingPeering.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteExistingPeering.cs new file mode 100644 index 000000000000..c9466027f998 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteExistingPeering.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 DeleteExistingPeering. + /// + public static class DeleteExistingPeering + { + public const string False = "False"; + public const string True = "True"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeploymentStatus.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeploymentStatus.cs new file mode 100644 index 000000000000..6386ef465c95 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeploymentStatus.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 DeploymentStatus. + /// + public static class DeploymentStatus + { + public const string NotStarted = "NotStarted"; + public const string Deploying = "Deploying"; + public const string Deployed = "Deployed"; + public const string Failed = "Failed"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveBaseSecurityAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveBaseSecurityAdminRule.cs new file mode 100644 index 000000000000..b330b2a67374 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveBaseSecurityAdminRule.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 Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Network base admin rule. + /// + public partial class EffectiveBaseSecurityAdminRule + { + /// + /// Initializes a new instance of the EffectiveBaseSecurityAdminRule + /// class. + /// + public EffectiveBaseSecurityAdminRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EffectiveBaseSecurityAdminRule + /// class. + /// + /// Resource ID. + /// A display name of the + /// security admin configuration. + /// A description of the + /// security admin configuration. + /// A display name of the rule + /// collection. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + public EffectiveBaseSecurityAdminRule(string id = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList)) + { + Id = id; + ConfigurationDisplayName = configurationDisplayName; + ConfigurationDescription = configurationDescription; + RuleCollectionDisplayName = ruleCollectionDisplayName; + RuleCollectionDescription = ruleCollectionDescription; + RuleCollectionAppliesToGroups = ruleCollectionAppliesToGroups; + RuleGroups = ruleGroups; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets a display name of the security admin configuration. + /// + [JsonProperty(PropertyName = "configurationDisplayName")] + public string ConfigurationDisplayName { get; set; } + + /// + /// Gets or sets a description of the security admin configuration. + /// + [JsonProperty(PropertyName = "configurationDescription")] + public string ConfigurationDescription { get; set; } + + /// + /// Gets or sets a display name of the rule collection. + /// + [JsonProperty(PropertyName = "ruleCollectionDisplayName")] + public string RuleCollectionDisplayName { get; set; } + + /// + /// Gets or sets a description of the rule collection. + /// + [JsonProperty(PropertyName = "ruleCollectionDescription")] + public string RuleCollectionDescription { get; set; } + + /// + /// Gets or sets groups for rule collection + /// + [JsonProperty(PropertyName = "ruleCollectionAppliesToGroups")] + public IList RuleCollectionAppliesToGroups { get; set; } + + /// + /// Gets or sets effective configuration groups. + /// + [JsonProperty(PropertyName = "ruleGroups")] + public IList RuleGroups { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveConnectivityConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveConnectivityConfiguration.cs new file mode 100644 index 000000000000..448c37b3af57 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveConnectivityConfiguration.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 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] + public partial class EffectiveConnectivityConfiguration + { + /// + /// Initializes a new instance of the + /// EffectiveConnectivityConfiguration class. + /// + public EffectiveConnectivityConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// EffectiveConnectivityConfiguration class. + /// + /// Connectivity topology type. + /// Possible values include: 'HubAndSpoke', 'Mesh' + /// Resource ID. + /// A friendly name for the resource. + /// A description of the connectivity + /// configuration. + /// 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' + /// Effective configuration + /// groups. + public EffectiveConnectivityConfiguration(string connectivityTopology, string id = default(string), string displayName = default(string), string description = default(string), IList hubs = default(IList), string isGlobal = default(string), IList appliesToGroups = default(IList), string provisioningState = default(string), string deleteExistingPeering = default(string), IList configurationGroups = default(IList)) + { + Id = id; + DisplayName = displayName; + Description = description; + ConnectivityTopology = connectivityTopology; + Hubs = hubs; + IsGlobal = isGlobal; + AppliesToGroups = appliesToGroups; + ProvisioningState = provisioningState; + DeleteExistingPeering = deleteExistingPeering; + ConfigurationGroups = configurationGroups; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets a friendly name for the resource. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// 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' + /// + [JsonProperty(PropertyName = "properties.connectivityTopology")] + public string ConnectivityTopology { get; set; } + + /// + /// Gets or sets list of hubItems + /// + [JsonProperty(PropertyName = "properties.hubs")] + public IList Hubs { get; set; } + + /// + /// Gets or sets flag if global mesh is supported. Possible values + /// include: 'False', 'True' + /// + [JsonProperty(PropertyName = "properties.isGlobal")] + public string IsGlobal { get; set; } + + /// + /// Gets or sets groups for configuration + /// + [JsonProperty(PropertyName = "properties.appliesToGroups")] + public IList AppliesToGroups { get; set; } + + /// + /// Gets the provisioning state of the connectivity configuration + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets flag if need to remove current existing peerings. + /// Possible values include: 'False', 'True' + /// + [JsonProperty(PropertyName = "properties.deleteExistingPeering")] + public string DeleteExistingPeering { get; set; } + + /// + /// Gets or sets effective configuration groups. + /// + [JsonProperty(PropertyName = "configurationGroups")] + public IList ConfigurationGroups { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ConnectivityTopology == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ConnectivityTopology"); + } + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveDefaultSecurityAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveDefaultSecurityAdminRule.cs new file mode 100644 index 000000000000..15426ac1fac8 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveDefaultSecurityAdminRule.cs @@ -0,0 +1,181 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 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] + public partial class EffectiveDefaultSecurityAdminRule : EffectiveBaseSecurityAdminRule + { + /// + /// Initializes a new instance of the EffectiveDefaultSecurityAdminRule + /// class. + /// + public EffectiveDefaultSecurityAdminRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EffectiveDefaultSecurityAdminRule + /// class. + /// + /// Resource ID. + /// A display name of the + /// security admin configuration. + /// A description of the + /// security admin configuration. + /// A display name of the rule + /// collection. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + /// A friendly name for the rule. + /// 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' + public EffectiveDefaultSecurityAdminRule(string id = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string displayName = default(string), 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)) + : base(id, configurationDisplayName, configurationDescription, ruleCollectionDisplayName, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) + { + DisplayName = displayName; + Description = description; + Flag = flag; + Protocol = protocol; + Sources = sources; + Destinations = destinations; + SourcePortRanges = sourcePortRanges; + DestinationPortRanges = destinationPortRanges; + Access = access; + Priority = priority; + Direction = direction; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a friendly name for the rule. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets a description for this rule. Restricted to 140 chars. + /// + [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; } + + /// + /// 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; } + + /// + /// Gets the CIDR or source IP ranges. + /// + [JsonProperty(PropertyName = "properties.sources")] + public IList Sources { get; private set; } + + /// + /// Gets the destination address prefixes. CIDR or destination IP + /// ranges. + /// + [JsonProperty(PropertyName = "properties.destinations")] + public IList Destinations { get; private set; } + + /// + /// Gets the source port ranges. + /// + [JsonProperty(PropertyName = "properties.sourcePortRanges")] + public 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; } + + /// + /// 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; } + + /// + /// 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; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs index 69143cd10cdb..640f4ea64681 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs @@ -31,14 +31,11 @@ public EffectiveNetworkSecurityGroupAssociation() /// 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. - public EffectiveNetworkSecurityGroupAssociation(SubResource networkManager = default(SubResource), SubResource subnet = default(SubResource), SubResource networkInterface = default(SubResource)) + public EffectiveNetworkSecurityGroupAssociation(SubResource subnet = default(SubResource), SubResource networkInterface = default(SubResource)) { - NetworkManager = networkManager; Subnet = subnet; NetworkInterface = networkInterface; CustomInit(); @@ -49,12 +46,6 @@ 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; } - /// /// Gets or sets the ID of the subnet if assigned. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveSecurityAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveSecurityAdminRule.cs new file mode 100644 index 000000000000..ca3b3fd40591 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveSecurityAdminRule.cs @@ -0,0 +1,201 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 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] + public partial class EffectiveSecurityAdminRule : EffectiveBaseSecurityAdminRule + { + /// + /// Initializes a new instance of the EffectiveSecurityAdminRule class. + /// + public EffectiveSecurityAdminRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EffectiveSecurityAdminRule class. + /// + /// 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' + /// Indicates if the traffic matched against + /// the rule in inbound or outbound. Possible values include: + /// 'Inbound', 'Outbound' + /// Resource ID. + /// A display name of the + /// security admin configuration. + /// A description of the + /// security admin configuration. + /// A display name of the rule + /// collection. + /// A description of the rule + /// collection. + /// Groups for rule + /// collection + /// Effective configuration groups. + /// A friendly name for the rule. + /// 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 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. + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + public EffectiveSecurityAdminRule(string protocol, string access, string direction, string id = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string displayName = default(string), string description = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), int? priority = default(int?), string provisioningState = default(string)) + : base(id, configurationDisplayName, configurationDescription, ruleCollectionDisplayName, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) + { + DisplayName = displayName; + Description = description; + Protocol = protocol; + Sources = sources; + Destinations = destinations; + SourcePortRanges = sourcePortRanges; + DestinationPortRanges = destinationPortRanges; + Access = access; + Priority = priority; + Direction = direction; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a friendly name for the rule. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// 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', 'Any', 'Ah' + /// + [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; } + + /// + /// Gets or sets the destination address prefixes. CIDR or destination + /// IP ranges. + /// + [JsonProperty(PropertyName = "properties.destinations")] + public IList Destinations { get; set; } + + /// + /// Gets or sets the source port ranges. + /// + [JsonProperty(PropertyName = "properties.sourcePortRanges")] + public IList SourcePortRanges { get; set; } + + /// + /// Gets or sets the destination port ranges. + /// + [JsonProperty(PropertyName = "properties.destinationPortRanges")] + public IList DestinationPortRanges { get; set; } + + /// + /// 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; } + + /// + /// 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; } + + /// + /// 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; } + + /// + /// 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) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 1); + } + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetwork.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetwork.cs new file mode 100644 index 000000000000..4712f6cf0c38 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetwork.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 Newtonsoft.Json; + using System.Linq; + + /// + /// Effective Virtual Network + /// + public partial class EffectiveVirtualNetwork + { + /// + /// Initializes a new instance of the EffectiveVirtualNetwork class. + /// + public EffectiveVirtualNetwork() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EffectiveVirtualNetwork class. + /// + /// Effective vnet Id. + /// Location of vnet. + /// Membership Type. Possible values + /// include: 'Static', 'Dynamic' + public EffectiveVirtualNetwork(string id = default(string), string location = default(string), string membershipType = default(string)) + { + Id = id; + Location = location; + MembershipType = membershipType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets effective vnet Id. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets location of vnet. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets membership Type. Possible values include: 'Static', + /// 'Dynamic' + /// + [JsonProperty(PropertyName = "membershipType")] + public string MembershipType { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksListResult.cs new file mode 100644 index 000000000000..12d17bf593d2 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksListResult.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 Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Result of the request to list Effective Virtual Network. It contains a + /// list of groups and a URL link to get the next set of results. + /// + public partial class EffectiveVirtualNetworksListResult + { + /// + /// Initializes a new instance of the + /// EffectiveVirtualNetworksListResult class. + /// + public EffectiveVirtualNetworksListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// EffectiveVirtualNetworksListResult class. + /// + /// Gets a page of EffectiveVirtualNetwork + /// 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 EffectiveVirtualNetworksListResult(IList value = default(IList), string skipToken = default(string)) + { + Value = value; + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a page of EffectiveVirtualNetwork + /// + [JsonProperty(PropertyName = "value")] + public 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. + /// + [JsonProperty(PropertyName = "skipToken")] + public string SkipToken { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksParameter.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksParameter.cs new file mode 100644 index 000000000000..c11954c68d29 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksParameter.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 Newtonsoft.Json; + using System.Linq; + + /// + /// Effective Virtual Networks Parameter. + /// + public partial class EffectiveVirtualNetworksParameter + { + /// + /// Initializes a new instance of the EffectiveVirtualNetworksParameter + /// class. + /// + public EffectiveVirtualNetworksParameter() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EffectiveVirtualNetworksParameter + /// class. + /// + /// Conditional Members. + /// Continuation token for pagination, + /// capturing the next page size and offset, as well as the context of + /// the query. + public EffectiveVirtualNetworksParameter(string conditionalMembers = default(string), string skipToken = default(string)) + { + ConditionalMembers = conditionalMembers; + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets conditional Members. + /// + [JsonProperty(PropertyName = "conditionalMembers")] + public string ConditionalMembers { get; set; } + + /// + /// 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; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExtendedLocation.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExtendedLocation.cs index 7456d0919b8f..831005217ace 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExtendedLocation.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExtendedLocation.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Management.Network.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -30,14 +31,18 @@ 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' - public ExtendedLocation(string name = default(string), string type = default(string)) + public ExtendedLocation(string name) { Name = name; - Type = type; CustomInit(); } + /// + /// Static constructor for ExtendedLocation class. + /// + static ExtendedLocation() + { + Type = "EdgeZone"; + } /// /// An initialization method that performs custom operations like setting defaults @@ -51,11 +56,23 @@ public ExtendedLocation() public string Name { get; set; } /// - /// Gets or sets the type of the extended location. Possible values - /// include: 'EdgeZone' + /// The type of the extended location. /// [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + public static string Type { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIpConfiguration.cs index ad66fc03d071..e3b82f118118 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIpConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIpConfiguration.cs @@ -55,8 +55,6 @@ public FrontendIPConfiguration() /// 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' @@ -68,7 +66,7 @@ public FrontendIPConfiguration() /// 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)) + 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), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string), IList zones = default(IList)) : base(id) { InboundNatRules = inboundNatRules; @@ -81,7 +79,6 @@ public FrontendIPConfiguration() Subnet = subnet; PublicIPAddress = publicIPAddress; PublicIPPrefix = publicIPPrefix; - GatewayLoadBalancer = gatewayLoadBalancer; ProvisioningState = provisioningState; Name = name; Etag = etag; @@ -161,12 +158,6 @@ public FrontendIPConfiguration() [JsonProperty(PropertyName = "properties.publicIPPrefix")] public SubResource PublicIPPrefix { get; set; } - /// - /// Gets or sets the reference to gateway load balancer frontend IP. - /// - [JsonProperty(PropertyName = "properties.gatewayLoadBalancer")] - public SubResource GatewayLoadBalancer { get; set; } - /// /// Gets the provisioning state of the frontend IP configuration /// resource. Possible values include: 'Succeeded', 'Updating', @@ -203,5 +194,18 @@ public FrontendIPConfiguration() [JsonProperty(PropertyName = "zones")] public IList Zones { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PublicIPAddress != null) + { + PublicIPAddress.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelInterface.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelInterface.cs deleted file mode 100644 index e074a3f6dfce..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelInterface.cs +++ /dev/null @@ -1,86 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Gateway load balancer tunnel interface of a load balancer backend - /// address pool. - /// - public partial class GatewayLoadBalancerTunnelInterface - { - /// - /// Initializes a new instance of the - /// GatewayLoadBalancerTunnelInterface class. - /// - public GatewayLoadBalancerTunnelInterface() - { - CustomInit(); - } - - /// - /// 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' - 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; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets port of gateway load balancer tunnel interface. - /// - [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; } - - /// - /// Gets or sets protocol of gateway load balancer tunnel interface. - /// Possible values include: 'None', 'Native', 'VXLAN' - /// - [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' - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelProtocol.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GroupConnectivity.cs similarity index 70% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelProtocol.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GroupConnectivity.cs index a4972933b927..1887920ed507 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelProtocol.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GroupConnectivity.cs @@ -12,12 +12,11 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for GatewayLoadBalancerTunnelProtocol. + /// Defines values for GroupConnectivity. /// - public static class GatewayLoadBalancerTunnelProtocol + public static class GroupConnectivity { public const string None = "None"; - public const string Native = "Native"; - public const string VXLAN = "VXLAN"; + public const string DirectlyConnected = "DirectlyConnected"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Sku.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GroupMembersItem.cs similarity index 60% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Sku.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GroupMembersItem.cs index 75f172a4cef6..51e0ebe19d36 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Sku.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GroupMembersItem.cs @@ -14,26 +14,25 @@ namespace Microsoft.Azure.Management.Network.Models using System.Linq; /// - /// The sku of this Bastion Host. + /// GroupMembers Item. /// - public partial class Sku + public partial class GroupMembersItem { /// - /// Initializes a new instance of the Sku class. + /// Initializes a new instance of the GroupMembersItem class. /// - public Sku() + public GroupMembersItem() { CustomInit(); } /// - /// Initializes a new instance of the Sku class. + /// Initializes a new instance of the GroupMembersItem class. /// - /// The name of this Bastion Host. Possible values - /// include: 'Basic', 'Standard' - public Sku(string name = default(string)) + /// Resource Id. + public GroupMembersItem(string resourceId = default(string)) { - Name = name; + ResourceId = resourceId; CustomInit(); } @@ -43,11 +42,10 @@ public Sku() partial void CustomInit(); /// - /// Gets or sets the name of this Bastion Host. Possible values - /// include: 'Basic', 'Standard' + /// Gets or sets resource Id. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [JsonProperty(PropertyName = "resourceId")] + public string ResourceId { get; set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Hub.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Hub.cs new file mode 100644 index 000000000000..a086b9d5dd9a --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Hub.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 Newtonsoft.Json; + using System.Linq; + + /// + /// Hub Item. + /// + public partial class Hub + { + /// + /// Initializes a new instance of the Hub class. + /// + public Hub() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Hub class. + /// + /// Resource Id. + /// Resource Type. + public Hub(string resourceId = default(string), string resourceType = default(string)) + { + ResourceId = resourceId; + ResourceType = resourceType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource Id. + /// + [JsonProperty(PropertyName = "resourceId")] + public string ResourceId { get; set; } + + /// + /// Gets or sets resource Type. + /// + [JsonProperty(PropertyName = "resourceType")] + public string ResourceType { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/HubIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/HubIpConfiguration.cs index fd8a90ac97a1..6c4362bf084d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/HubIpConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/HubIpConfiguration.cs @@ -119,5 +119,18 @@ public HubIpConfiguration() [JsonProperty(PropertyName = "type")] public string Type { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PublicIPAddress != null) + { + PublicIPAddress.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPConfiguration.cs index 7141647772af..5bca8e8b4870 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPConfiguration.cs @@ -114,5 +114,18 @@ public IPConfiguration() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PublicIPAddress != null) + { + PublicIPAddress.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/InboundNatRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/InboundNatRule.cs index 81c585da4bfa..7efd2ff41914 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/InboundNatRule.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/InboundNatRule.cs @@ -182,5 +182,18 @@ public InboundNatRule() [JsonProperty(PropertyName = "type")] public string Type { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (BackendIPConfiguration != null) + { + BackendIPConfiguration.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SyncRemoteAddressSpace.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IsGlobal.cs similarity index 74% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SyncRemoteAddressSpace.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IsGlobal.cs index 80df58a83add..11c8db830ff0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SyncRemoteAddressSpace.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IsGlobal.cs @@ -12,10 +12,11 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for SyncRemoteAddressSpace. + /// Defines values for IsGlobal. /// - public static class SyncRemoteAddressSpace + public static class IsGlobal { - public const string True = "true"; + public const string False = "False"; + public const string True = "True"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancer.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancer.cs index 17b7fe0ef374..7db69cc00db7 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancer.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancer.cs @@ -190,5 +190,78 @@ public LoadBalancer() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ExtendedLocation != null) + { + ExtendedLocation.Validate(); + } + if (FrontendIPConfigurations != null) + { + foreach (var element in FrontendIPConfigurations) + { + if (element != null) + { + element.Validate(); + } + } + } + if (LoadBalancingRules != null) + { + foreach (var element1 in LoadBalancingRules) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + if (Probes != null) + { + foreach (var element2 in Probes) + { + if (element2 != null) + { + element2.Validate(); + } + } + } + if (InboundNatRules != null) + { + foreach (var element3 in InboundNatRules) + { + if (element3 != null) + { + element3.Validate(); + } + } + } + if (InboundNatPools != null) + { + foreach (var element4 in InboundNatPools) + { + if (element4 != null) + { + element4.Validate(); + } + } + } + if (OutboundRules != null) + { + foreach (var element5 in OutboundRules) + { + if (element5 != null) + { + element5.Validate(); + } + } + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSku.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSku.cs index 17e411b38951..b7daccca169d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSku.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSku.cs @@ -30,7 +30,7 @@ public LoadBalancerSku() /// Initializes a new instance of the LoadBalancerSku class. /// /// Name of a load balancer SKU. Possible values - /// include: 'Basic', 'Standard', 'Gateway' + /// include: 'Basic', 'Standard' /// Tier of a load balancer SKU. Possible values /// include: 'Regional', 'Global' public LoadBalancerSku(string name = default(string), string tier = default(string)) @@ -47,7 +47,7 @@ public LoadBalancerSku() /// /// Gets or sets name of a load balancer SKU. Possible values include: - /// 'Basic', 'Standard', 'Gateway' + /// 'Basic', 'Standard' /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSkuName.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSkuName.cs index bad640c6edd2..47d143e327b1 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSkuName.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSkuName.cs @@ -18,6 +18,5 @@ public static class LoadBalancerSkuName { public const string Basic = "Basic"; public const string Standard = "Standard"; - public const string Gateway = "Gateway"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequest.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequest.cs deleted file mode 100644 index fd58d9f58f70..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequest.cs +++ /dev/null @@ -1,55 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The request for a VIP swap. - /// - public partial class LoadBalancerVipSwapRequest - { - /// - /// Initializes a new instance of the LoadBalancerVipSwapRequest class. - /// - public LoadBalancerVipSwapRequest() - { - CustomInit(); - } - - /// - /// 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)) - { - FrontendIPConfigurations = frontendIPConfigurations; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a list of frontend IP configuration resources that - /// should swap VIPs. - /// - [JsonProperty(PropertyName = "frontendIPConfigurations")] - public IList FrontendIPConfigurations { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequestFrontendIPConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequestFrontendIPConfiguration.cs deleted file mode 100644 index becef2a1e7ed..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequestFrontendIPConfiguration.cs +++ /dev/null @@ -1,66 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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. - /// - [Rest.Serialization.JsonTransformation] - public partial class LoadBalancerVipSwapRequestFrontendIPConfiguration - { - /// - /// Initializes a new instance of the - /// LoadBalancerVipSwapRequestFrontendIPConfiguration class. - /// - public LoadBalancerVipSwapRequestFrontendIPConfiguration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// LoadBalancerVipSwapRequestFrontendIPConfiguration class. - /// - /// 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; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the ID of frontend IP configuration resource. - /// - [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; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancingRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancingRule.cs index 109185a6cc7e..ba4e7129fca1 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancingRule.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancingRule.cs @@ -13,8 +13,6 @@ 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; /// @@ -47,8 +45,6 @@ public LoadBalancingRule() /// 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 @@ -81,12 +77,11 @@ public LoadBalancingRule() /// 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)) + public LoadBalancingRule(string protocol, int frontendPort, string id = default(string), SubResource frontendIPConfiguration = default(SubResource), SubResource backendAddressPool = default(SubResource), 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) { FrontendIPConfiguration = frontendIPConfiguration; BackendAddressPool = backendAddressPool; - BackendAddressPools = backendAddressPools; Probe = probe; Protocol = protocol; LoadDistribution = loadDistribution; @@ -121,12 +116,6 @@ public LoadBalancingRule() [JsonProperty(PropertyName = "properties.backendAddressPool")] public SubResource BackendAddressPool { get; set; } - /// - /// Gets or sets an array of references to pool of DIPs. - /// - [JsonProperty(PropertyName = "properties.backendAddressPools")] - public IList BackendAddressPools { get; set; } - /// /// Gets or sets the reference to the load balancer probe used by the /// load balancing rule. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MembershipType.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MembershipType.cs new file mode 100644 index 000000000000..4b0ba6401381 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MembershipType.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 MembershipType. + /// + public static class MembershipType + { + public const string Static = "Static"; + public const string Dynamic = "Dynamic"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroup.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroup.cs new file mode 100644 index 000000000000..954e1fb23a80 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroup.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 Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The network group resource + /// + [Rest.Serialization.JsonTransformation] + public partial class NetworkGroup : ProxyResource + { + /// + /// Initializes a new instance of the NetworkGroup class. + /// + public NetworkGroup() + { + CustomInit(); + } + + /// + /// 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 friendly name for the network + /// group. + /// A description of the network + /// group. + /// Group member type. + /// Group members of network group. + /// Network group conditional + /// filter. + /// The provisioning state of the scope + /// assignment resource. Possible values include: 'Succeeded', + /// 'Updating', 'Deleting', 'Failed' + /// 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 displayName = default(string), string description = default(string), string memberType = default(string), IList groupMembers = default(IList), string conditionalMembership = default(string), string provisioningState = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, etag) + { + DisplayName = displayName; + Description = description; + MemberType = memberType; + GroupMembers = groupMembers; + ConditionalMembership = conditionalMembership; + ProvisioningState = provisioningState; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a friendly name for the network group. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets a description of the network group. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets group member type. + /// + [JsonProperty(PropertyName = "properties.memberType")] + public string MemberType { get; set; } + + /// + /// Gets or sets group members of network group. + /// + [JsonProperty(PropertyName = "properties.groupMembers")] + public IList GroupMembers { get; set; } + + /// + /// Gets or sets network group conditional filter. + /// + [JsonProperty(PropertyName = "properties.conditionalMembership")] + public string ConditionalMembership { get; set; } + + /// + /// 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; } + + /// + /// Gets the system metadata related to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroupsCreateOrUpdateHeaders.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroupsCreateOrUpdateHeaders.cs new file mode 100644 index 000000000000..dde367cf19ed --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroupsCreateOrUpdateHeaders.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for CreateOrUpdate operation. + /// + public partial class NetworkGroupsCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the + /// NetworkGroupsCreateOrUpdateHeaders class. + /// + public NetworkGroupsCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// NetworkGroupsCreateOrUpdateHeaders class. + /// + /// The current entity tag. + public NetworkGroupsCreateOrUpdateHeaders(string eTag = default(string)) + { + ETag = eTag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the current entity tag. + /// + [JsonProperty(PropertyName = "ETag")] + public string ETag { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterface.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterface.cs index e9a8ebc700fb..9bedac0024b0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterface.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterface.cs @@ -70,8 +70,6 @@ public NetworkInterface() /// 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 @@ -81,7 +79,7 @@ public NetworkInterface() /// 'Abort', 'Committed' /// 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? enableAcceleratedNetworking = 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 etag = default(string)) + 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? enableAcceleratedNetworking = default(bool?), bool? enableIPForwarding = default(bool?), IList hostedWorkloads = default(IList), SubResource dscpConfiguration = default(SubResource), string resourceGuid = default(string), string provisioningState = default(string), string nicType = default(string), PrivateLinkService privateLinkService = default(PrivateLinkService), string migrationPhase = default(string), string etag = default(string)) : base(id, name, type, location, tags) { ExtendedLocation = extendedLocation; @@ -99,7 +97,6 @@ public NetworkInterface() DscpConfiguration = dscpConfiguration; ResourceGuid = resourceGuid; ProvisioningState = provisioningState; - WorkloadType = workloadType; NicType = nicType; PrivateLinkService = privateLinkService; MigrationPhase = migrationPhase; @@ -209,13 +206,6 @@ public NetworkInterface() [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } - /// - /// Gets or sets workloadType of the NetworkInterface for BareMetal - /// resources - /// - [JsonProperty(PropertyName = "properties.workloadType")] - public string WorkloadType { get; set; } - /// /// Gets or sets type of Network Interface resource. Possible values /// include: 'Standard', 'Elastic' @@ -244,5 +234,46 @@ public NetworkInterface() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ExtendedLocation != null) + { + ExtendedLocation.Validate(); + } + if (PrivateEndpoint != null) + { + PrivateEndpoint.Validate(); + } + if (IpConfigurations != null) + { + foreach (var element in IpConfigurations) + { + if (element != null) + { + element.Validate(); + } + } + } + if (TapConfigurations != null) + { + foreach (var element1 in TapConfigurations) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + if (PrivateLinkService != null) + { + PrivateLinkService.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIpConfiguration.cs index 80fbd5539228..89f950d3af69 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIpConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIpConfiguration.cs @@ -37,8 +37,6 @@ public NetworkInterfaceIPConfiguration() /// class. /// /// Resource ID. - /// The reference to gateway load - /// balancer frontend IP. /// The reference to Virtual Network /// Taps. /// The reference @@ -73,10 +71,9 @@ public NetworkInterfaceIPConfiguration() /// 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)) + public NetworkInterfaceIPConfiguration(string id = default(string), 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) { - GatewayLoadBalancer = gatewayLoadBalancer; VirtualNetworkTaps = virtualNetworkTaps; ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; LoadBalancerBackendAddressPools = loadBalancerBackendAddressPools; @@ -101,12 +98,6 @@ public NetworkInterfaceIPConfiguration() /// partial void CustomInit(); - /// - /// Gets or sets the reference to gateway load balancer frontend IP. - /// - [JsonProperty(PropertyName = "properties.gatewayLoadBalancer")] - public SubResource GatewayLoadBalancer { get; set; } - /// /// Gets or sets the reference to Virtual Network Taps. /// @@ -213,5 +204,38 @@ public NetworkInterfaceIPConfiguration() [JsonProperty(PropertyName = "type")] public string Type { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (VirtualNetworkTaps != null) + { + foreach (var element in VirtualNetworkTaps) + { + if (element != null) + { + element.Validate(); + } + } + } + if (LoadBalancerInboundNatRules != null) + { + foreach (var element1 in LoadBalancerInboundNatRules) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + if (PublicIPAddress != null) + { + PublicIPAddress.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceTapConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceTapConfiguration.cs index 7be020d7ccf3..2b922b608c31 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceTapConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceTapConfiguration.cs @@ -96,5 +96,18 @@ public NetworkInterfaceTapConfiguration() [JsonProperty(PropertyName = "type")] public string Type { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (VirtualNetworkTap != null) + { + VirtualNetworkTap.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManager.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManager.cs new file mode 100644 index 000000000000..4e4ac7a275b5 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManager.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 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] + public partial class NetworkManager : Resource + { + /// + /// Initializes a new instance of the NetworkManager class. + /// + public NetworkManager() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkManager class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// A friendly name for the network + /// manager. + /// A description of the network + /// manager. + /// Scope of Network + /// Manager. + /// Scope Access. + /// The provisioning state of the scope + /// assignment resource. Possible values include: 'Succeeded', + /// 'Updating', 'Deleting', 'Failed' + /// A unique read-only string that changes whenever + /// the resource is updated. + /// The system metadata related to this + /// resource. + public NetworkManager(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string displayName = default(string), string description = default(string), NetworkManagerPropertiesNetworkManagerScopes networkManagerScopes = default(NetworkManagerPropertiesNetworkManagerScopes), IList networkManagerScopeAccesses = default(IList), string provisioningState = default(string), string etag = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, location, tags) + { + DisplayName = displayName; + Description = description; + NetworkManagerScopes = networkManagerScopes; + NetworkManagerScopeAccesses = networkManagerScopeAccesses; + ProvisioningState = provisioningState; + Etag = etag; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a friendly name for the network manager. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// 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. + /// + [JsonProperty(PropertyName = "properties.networkManagerScopes")] + public NetworkManagerPropertiesNetworkManagerScopes NetworkManagerScopes { get; set; } + + /// + /// Gets or sets scope Access. + /// + [JsonProperty(PropertyName = "properties.networkManagerScopeAccesses")] + public IList NetworkManagerScopeAccesses { get; set; } + + /// + /// 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; } + + /// + /// Gets a unique read-only string that changes whenever the resource + /// is updated. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + /// + /// Gets the system metadata related to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerCommit.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerCommit.cs new file mode 100644 index 000000000000..29bacf96030c --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerCommit.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 Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Network Manager Commit. + /// + public partial class NetworkManagerCommit + { + /// + /// Initializes a new instance of the NetworkManagerCommit class. + /// + public NetworkManagerCommit() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkManagerCommit class. + /// + /// Commit Id. + /// List of target locations. + /// List of configuration ids. + /// Commit Type. Possible values include: + /// 'SecurityAdmin', 'SecurityUser', 'Connectivity' + public NetworkManagerCommit(string commitId = default(string), IList targetLocations = default(IList), IList configurationIds = default(IList), string commitType = default(string)) + { + CommitId = commitId; + TargetLocations = targetLocations; + ConfigurationIds = configurationIds; + CommitType = commitType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets commit Id. + /// + [JsonProperty(PropertyName = "commitId")] + public string CommitId { get; private set; } + + /// + /// Gets or sets list of target locations. + /// + [JsonProperty(PropertyName = "targetLocations")] + public IList TargetLocations { get; set; } + + /// + /// Gets or sets list of configuration ids. + /// + [JsonProperty(PropertyName = "configurationIds")] + public IList ConfigurationIds { get; set; } + + /// + /// Gets or sets commit Type. Possible values include: 'SecurityAdmin', + /// 'SecurityUser', 'Connectivity' + /// + [JsonProperty(PropertyName = "commitType")] + public string CommitType { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatus.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatus.cs new file mode 100644 index 000000000000..3889883d399b --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatus.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 Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Network Manager Deployment Status. + /// + public partial class NetworkManagerDeploymentStatus + { + /// + /// Initializes a new instance of the NetworkManagerDeploymentStatus + /// class. + /// + public NetworkManagerDeploymentStatus() + { + CustomInit(); + } + + /// + /// 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', 'SecurityUser', '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)) + { + CommitTime = commitTime; + Region = region; + DeploymentStatus = deploymentStatus; + ConfigurationIds = configurationIds; + DeploymentType = deploymentType; + ErrorMessage = errorMessage; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets commit Time. + /// + [JsonProperty(PropertyName = "commitTime")] + public System.DateTime? CommitTime { get; set; } + + /// + /// Gets or sets region Name. + /// + [JsonProperty(PropertyName = "region")] + public string Region { get; set; } + + /// + /// Gets or sets deployment Status. Possible values include: + /// 'NotStarted', 'Deploying', 'Deployed', 'Failed' + /// + [JsonProperty(PropertyName = "deploymentStatus")] + public string DeploymentStatus { get; set; } + + /// + /// Gets or sets list of configuration ids. + /// + [JsonProperty(PropertyName = "configurationIds")] + public IList ConfigurationIds { get; set; } + + /// + /// Gets or sets possible values include: 'SecurityAdmin', + /// 'SecurityUser', 'Connectivity' + /// + [JsonProperty(PropertyName = "deploymentType")] + public string DeploymentType { get; set; } + + /// + /// Gets or sets error Message. + /// + [JsonProperty(PropertyName = "errorMessage")] + public string ErrorMessage { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusListResult.cs new file mode 100644 index 000000000000..383a5dda10df --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusListResult.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 Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A list of Network Manager Deployment Status + /// + public partial class NetworkManagerDeploymentStatusListResult + { + /// + /// Initializes a new instance of the + /// NetworkManagerDeploymentStatusListResult class. + /// + public NetworkManagerDeploymentStatusListResult() + { + CustomInit(); + } + + /// + /// 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)) + { + Value = value; + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a page of Network Manager Deployment Status + /// + [JsonProperty(PropertyName = "value")] + public 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. + /// + [JsonProperty(PropertyName = "skipToken")] + public string SkipToken { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusParameter.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusParameter.cs new file mode 100644 index 000000000000..5f72882b1163 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusParameter.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 Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Network Manager Deployment Status Parameter. + /// + public partial class NetworkManagerDeploymentStatusParameter + { + /// + /// Initializes a new instance of the + /// NetworkManagerDeploymentStatusParameter class. + /// + public NetworkManagerDeploymentStatusParameter() + { + CustomInit(); + } + + /// + /// 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)) + { + Regions = regions; + DeploymentTypes = deploymentTypes; + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of locations. + /// + [JsonProperty(PropertyName = "regions")] + public IList Regions { get; set; } + + /// + /// Gets or sets list of deployment types. + /// + [JsonProperty(PropertyName = "deploymentTypes")] + public 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. + /// + [JsonProperty(PropertyName = "skipToken")] + public string SkipToken { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveConnectivityConfigurationListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveConnectivityConfigurationListResult.cs new file mode 100644 index 000000000000..3450d169eb10 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveConnectivityConfigurationListResult.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 Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Result of the request to list + /// networkManagerEffectiveConnectivityConfiguration. It contains a list of + /// groups and a skiptoken to get the next set of results. + /// + public partial class NetworkManagerEffectiveConnectivityConfigurationListResult + { + /// + /// Initializes a new instance of the + /// NetworkManagerEffectiveConnectivityConfigurationListResult class. + /// + public NetworkManagerEffectiveConnectivityConfigurationListResult() + { + CustomInit(); + } + + /// + /// 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)) + { + Value = value; + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a page of NetworkManagerEffectiveConnectivityConfiguration + /// + [JsonProperty(PropertyName = "value")] + public 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. + /// + [JsonProperty(PropertyName = "skipToken")] + public string SkipToken { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveSecurityAdminRulesListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveSecurityAdminRulesListResult.cs new file mode 100644 index 000000000000..aa26d6280c37 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveSecurityAdminRulesListResult.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 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. + /// + public partial class NetworkManagerEffectiveSecurityAdminRulesListResult + { + /// + /// Initializes a new instance of the + /// NetworkManagerEffectiveSecurityAdminRulesListResult class. + /// + public NetworkManagerEffectiveSecurityAdminRulesListResult() + { + CustomInit(); + } + + /// + /// 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)) + { + Value = value; + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a page of NetworkManagerEffectiveSecurityAdminRules + /// + [JsonProperty(PropertyName = "value")] + public 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. + /// + [JsonProperty(PropertyName = "skipToken")] + public string SkipToken { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerPropertiesNetworkManagerScopes.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerPropertiesNetworkManagerScopes.cs new file mode 100644 index 000000000000..0812942d9e55 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerPropertiesNetworkManagerScopes.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Scope of Network Manager. + /// + public partial class NetworkManagerPropertiesNetworkManagerScopes + { + /// + /// Initializes a new instance of the + /// NetworkManagerPropertiesNetworkManagerScopes class. + /// + public NetworkManagerPropertiesNetworkManagerScopes() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// NetworkManagerPropertiesNetworkManagerScopes class. + /// + /// List of management groups. + /// List of subscriptions. + public NetworkManagerPropertiesNetworkManagerScopes(IList managementGroups = default(IList), IList subscriptions = default(IList)) + { + ManagementGroups = managementGroups; + Subscriptions = subscriptions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of management groups. + /// + [JsonProperty(PropertyName = "managementGroups")] + public IList ManagementGroups { get; set; } + + /// + /// Gets or sets list of subscriptions. + /// + [JsonProperty(PropertyName = "subscriptions")] + public IList Subscriptions { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerSecurityGroupItem.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerSecurityGroupItem.cs new file mode 100644 index 000000000000..a85140d0bd77 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerSecurityGroupItem.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 Newtonsoft.Json; + using System.Linq; + + /// + /// Network manager security group item. + /// + public partial class NetworkManagerSecurityGroupItem + { + /// + /// Initializes a new instance of the NetworkManagerSecurityGroupItem + /// class. + /// + public NetworkManagerSecurityGroupItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkManagerSecurityGroupItem + /// class. + /// + /// Network manager group Id. + public NetworkManagerSecurityGroupItem(string networkGroupId = default(string)) + { + NetworkGroupId = networkGroupId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets network manager group Id. + /// + [JsonProperty(PropertyName = "networkGroupId")] + public string NetworkGroupId { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkSecurityPerimeter.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkSecurityPerimeter.cs new file mode 100644 index 000000000000..7882f7a10120 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkSecurityPerimeter.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 Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The Network Security Perimeter resource + /// + [Rest.Serialization.JsonTransformation] + public partial class NetworkSecurityPerimeter : Resource + { + /// + /// Initializes a new instance of the NetworkSecurityPerimeter class. + /// + public NetworkSecurityPerimeter() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkSecurityPerimeter class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// A friendly name for the network security + /// perimeter. + /// A description of the network security + /// perimeter. + /// The provisioning state of the scope + /// assignment resource. Possible values include: 'Succeeded', + /// 'Updating', 'Deleting', 'Failed' + /// A unique read-only string that changes whenever + /// the resource is updated. + public NetworkSecurityPerimeter(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string displayName = default(string), string description = default(string), string provisioningState = default(string), string etag = default(string)) + : base(id, name, type, location, tags) + { + DisplayName = displayName; + Description = description; + ProvisioningState = provisioningState; + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a friendly name for the network security perimeter. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets a description of the network security perimeter. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// 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; } + + /// + /// Gets a unique read-only string that changes whenever the resource + /// is updated. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PerimeterAssociableResource.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PerimeterAssociableResource.cs new file mode 100644 index 000000000000..14e898b1e6cb --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PerimeterAssociableResource.cs @@ -0,0 +1,84 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Resource that is onboarded to use network security perimeter. Also + /// referred as perimeter associable resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class PerimeterAssociableResource : Resource + { + /// + /// Initializes a new instance of the PerimeterAssociableResource + /// class. + /// + public PerimeterAssociableResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PerimeterAssociableResource + /// class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// Resource location. + /// Resource tags. + /// A friendly name for the properties of + /// perimeter associable resources. + /// Resource type/provider name. + /// Public DNS zone names of the + /// resources. + public PerimeterAssociableResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string displayName = default(string), string resourceType = default(string), IList publicDnsZones = default(IList)) + : base(id, name, type, location, tags) + { + DisplayName = displayName; + ResourceType = resourceType; + PublicDnsZones = publicDnsZones; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a friendly name for the properties of perimeter associable + /// resources. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets resource type/provider name. + /// + [JsonProperty(PropertyName = "properties.resourceType")] + public string ResourceType { get; private set; } + + /// + /// Gets public DNS zone names of the resources. + /// + [JsonProperty(PropertyName = "properties.publicDnsZones")] + public IList PublicDnsZones { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PerimeterAssociableResourcesListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PerimeterAssociableResourcesListResult.cs new file mode 100644 index 000000000000..7841fb7b56a8 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PerimeterAssociableResourcesListResult.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Paged list of perimeter associable resources. + /// + public partial class PerimeterAssociableResourcesListResult + { + /// + /// Initializes a new instance of the + /// PerimeterAssociableResourcesListResult class. + /// + public PerimeterAssociableResourcesListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// PerimeterAssociableResourcesListResult class. + /// + /// Gets paged list of perimeter associable + /// resources. + /// Gets the URL to get the next page of + /// results. + public PerimeterAssociableResourcesListResult(IList value = default(IList), string nextLink = default(string)) + { + Value = value; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets paged list of perimeter associable resources. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets the URL to get the next page of results. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PolicySettings.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PolicySettings.cs index 15ebdf469c64..69188a800488 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PolicySettings.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PolicySettings.cs @@ -95,6 +95,10 @@ public PolicySettings() /// public virtual void Validate() { + if (MaxRequestBodySizeInKb > 128) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxRequestBodySizeInKb", 128); + } if (MaxRequestBodySizeInKb < 8) { throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxRequestBodySizeInKb", 8); diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpoint.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpoint.cs index 9c28f6475d5e..e4977861001f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpoint.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpoint.cs @@ -133,5 +133,28 @@ public PrivateEndpoint() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ExtendedLocation != null) + { + ExtendedLocation.Validate(); + } + if (NetworkInterfaces != null) + { + foreach (var element in NetworkInterfaces) + { + if (element != null) + { + element.Validate(); + } + } + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpointConnection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpointConnection.cs index 575e64c9ed23..484410d7d937 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpointConnection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpointConnection.cs @@ -113,5 +113,18 @@ public PrivateEndpointConnection() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (PrivateEndpoint != null) + { + PrivateEndpoint.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateLinkService.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateLinkService.cs index 2929365f8956..4280b3ff149c 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateLinkService.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateLinkService.cs @@ -163,5 +163,48 @@ public PrivateLinkService() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ExtendedLocation != null) + { + ExtendedLocation.Validate(); + } + if (LoadBalancerFrontendIpConfigurations != null) + { + foreach (var element in LoadBalancerFrontendIpConfigurations) + { + if (element != null) + { + element.Validate(); + } + } + } + if (NetworkInterfaces != null) + { + foreach (var element1 in NetworkInterfaces) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + if (PrivateEndpointConnections != null) + { + foreach (var element2 in PrivateEndpointConnections) + { + if (element2 != null) + { + element2.Validate(); + } + } + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ProxyResource.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ProxyResource.cs new file mode 100644 index 000000000000..8480d098c562 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ProxyResource.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 Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Proxy resource representation. + /// + public partial class ProxyResource : IResource + { + /// + /// Initializes a new instance of the ProxyResource class. + /// + public ProxyResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProxyResource class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + public ProxyResource(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) + { + Id = id; + Name = name; + Type = type; + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource ID. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets resource name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { 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; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPPrefix.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPPrefix.cs index 9492698563f9..83118c047128 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPPrefix.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPPrefix.cs @@ -182,5 +182,18 @@ public PublicIPPrefix() [JsonProperty(PropertyName = "zones")] public IList Zones { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ExtendedLocation != null) + { + ExtendedLocation.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddress.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddress.cs index e3988bc735bb..97606232a8c1 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddress.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddress.cs @@ -75,14 +75,11 @@ public PublicIPAddress() /// '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)) + 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 etag = default(string), IList zones = default(IList)) : base(id, name, type, location, tags) { ExtendedLocation = extendedLocation; @@ -102,7 +99,6 @@ public PublicIPAddress() NatGateway = natGateway; MigrationPhase = migrationPhase; LinkedPublicIPAddress = linkedPublicIPAddress; - DeleteOption = deleteOption; Etag = etag; Zones = zones; CustomInit(); @@ -227,13 +223,6 @@ public PublicIPAddress() [JsonProperty(PropertyName = "properties.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' - /// - [JsonProperty(PropertyName = "properties.deleteOption")] - public string DeleteOption { get; set; } - /// /// Gets a unique read-only string that changes whenever the resource /// is updated. @@ -248,5 +237,30 @@ public PublicIPAddress() [JsonProperty(PropertyName = "zones")] public IList Zones { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ExtendedLocation != null) + { + ExtendedLocation.Validate(); + } + if (IpConfiguration != null) + { + IpConfiguration.Validate(); + } + if (ServicePublicIPAddress != null) + { + ServicePublicIPAddress.Validate(); + } + if (LinkedPublicIPAddress != null) + { + LinkedPublicIPAddress.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/QueryRequestOptions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/QueryRequestOptions.cs new file mode 100644 index 000000000000..2f0f13cbc502 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/QueryRequestOptions.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 Newtonsoft.Json; + using System.Linq; + + /// + /// Query Request Options + /// + public partial class QueryRequestOptions + { + /// + /// Initializes a new instance of the QueryRequestOptions class. + /// + public QueryRequestOptions() + { + CustomInit(); + } + + /// + /// 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. + public QueryRequestOptions(string skipToken = default(string)) + { + SkipToken = skipToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + 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. + /// + [JsonProperty(PropertyName = "skipToken")] + public string SkipToken { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/RuleCollection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/RuleCollection.cs new file mode 100644 index 000000000000..2cca3c7c7b08 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/RuleCollection.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 Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Defines the rule collection. + /// + [Rest.Serialization.JsonTransformation] + public partial class RuleCollection : ProxyResource + { + /// + /// Initializes a new instance of the RuleCollection class. + /// + public RuleCollection() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RuleCollection class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + /// A display name of the rule + /// collection. + /// A description of the rule + /// collection. + /// Groups for configuration + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + /// The system metadata related to this + /// resource. + public RuleCollection(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string displayName = default(string), string description = default(string), IList appliesToGroups = default(IList), string provisioningState = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, etag) + { + DisplayName = displayName; + Description = description; + AppliesToGroups = appliesToGroups; + ProvisioningState = provisioningState; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a display name of the rule collection. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets a description of the rule collection. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets groups for configuration + /// + [JsonProperty(PropertyName = "properties.appliesToGroups")] + public IList AppliesToGroups { 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; } + + /// + /// Gets the system metadata related to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfiguration.cs new file mode 100644 index 000000000000..7656ef08ae43 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfiguration.cs @@ -0,0 +1,111 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines the security configuration + /// + [Rest.Serialization.JsonTransformation] + public partial class SecurityConfiguration : ProxyResource + { + /// + /// Initializes a new instance of the SecurityConfiguration class. + /// + public SecurityConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SecurityConfiguration class. + /// + /// Resource ID. + /// Resource name. + /// Resource type. + /// A unique read-only string that changes whenever + /// the resource is updated. + /// A display name of the security + /// configuration. + /// A description of the security + /// configuration. + /// Security Type. Possible values include: + /// 'AdminPolicy', 'UserPolicy' + /// Flag if need to delete existing + /// network security groups. Possible values include: 'False', + /// 'True' + /// The provisioning state of the + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + /// The system metadata related to this + /// resource. + public SecurityConfiguration(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string displayName = default(string), string description = default(string), string securityType = default(string), string deleteExistingNSGs = default(string), string provisioningState = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, etag) + { + DisplayName = displayName; + Description = description; + SecurityType = securityType; + DeleteExistingNSGs = deleteExistingNSGs; + ProvisioningState = provisioningState; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a display name of the security configuration. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets a description of the security configuration. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets security Type. Possible values include: 'AdminPolicy', + /// 'UserPolicy' + /// + [JsonProperty(PropertyName = "properties.securityType")] + public string SecurityType { get; set; } + + /// + /// Gets or sets flag if need to delete existing network security + /// groups. Possible values include: 'False', 'True' + /// + [JsonProperty(PropertyName = "properties.deleteExistingNSGs")] + public string DeleteExistingNSGs { 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; } + + /// + /// Gets the system metadata related to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PreferredRoutingGateway.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleAccess.cs similarity index 63% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PreferredRoutingGateway.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleAccess.cs index 0e8946f41322..8fa24ddae16e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PreferredRoutingGateway.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleAccess.cs @@ -12,12 +12,12 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for PreferredRoutingGateway. + /// Defines values for SecurityConfigurationRuleAccess. /// - public static class PreferredRoutingGateway + public static class SecurityConfigurationRuleAccess { - public const string ExpressRoute = "ExpressRoute"; - public const string VpnGateway = "VpnGateway"; - public const string None = "None"; + public const string Allow = "Allow"; + public const string Deny = "Deny"; + public const string AlwaysAllow = "AlwaysAllow"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleDirection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleDirection.cs new file mode 100644 index 000000000000..266a50b5281a --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleDirection.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 SecurityConfigurationRuleDirection. + /// + public static class SecurityConfigurationRuleDirection + { + public const string Inbound = "Inbound"; + public const string Outbound = "Outbound"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleProtocol.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleProtocol.cs new file mode 100644 index 000000000000..d4ca62c2e1b8 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleProtocol.cs @@ -0,0 +1,26 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 SecurityConfigurationRuleProtocol. + /// + public static class SecurityConfigurationRuleProtocol + { + public const string Tcp = "Tcp"; + public const string Udp = "Udp"; + public const string Icmp = "Icmp"; + public const string Esp = "Esp"; + public const string Any = "Any"; + public const string Ah = "Ah"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityType.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityType.cs new file mode 100644 index 000000000000..917cef4ae48f --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityType.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 SecurityType. + /// + public static class SecurityType + { + public const string AdminPolicy = "AdminPolicy"; + public const string UserPolicy = "UserPolicy"; + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SystemData.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SystemData.cs new file mode 100644 index 000000000000..c8f4a089574c --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SystemData.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 Newtonsoft.Json; + using System.Linq; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class SystemData + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// 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. + 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; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity that created the resource. + /// + [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' + /// + [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; } + + /// + /// Gets or sets the identity that last modified the resource. + /// + [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' + /// + [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; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteOptions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UseHubGateway.cs similarity index 72% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteOptions.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UseHubGateway.cs index 79c56e63572b..6bf6370a4632 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteOptions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UseHubGateway.cs @@ -12,11 +12,11 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for DeleteOptions. + /// Defines values for UseHubGateway. /// - public static class DeleteOptions + public static class UseHubGateway { - public const string Delete = "Delete"; - public const string Detach = "Detach"; + public const string False = "False"; + public const string True = "True"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UserRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UserRule.cs new file mode 100644 index 000000000000..27563356a0c2 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UserRule.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 Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Network security user rule. + /// + [Newtonsoft.Json.JsonObject("Custom")] + [Rest.Serialization.JsonTransformation] + public partial class UserRule : BaseUserRule + { + /// + /// Initializes a new instance of the UserRule class. + /// + public UserRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UserRule class. + /// + /// Network protocol this rule applies to. + /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', + /// 'Ah' + /// 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 friendly name for the rule. + /// A description for this rule. + /// 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 + /// security configuration user rule resource. Possible values include: + /// 'Succeeded', 'Updating', 'Deleting', 'Failed' + public UserRule(string protocol, string direction, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string displayName = default(string), string description = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), string provisioningState = default(string)) + : base(id, name, type, etag, systemData) + { + DisplayName = displayName; + Description = description; + Protocol = protocol; + Sources = sources; + Destinations = destinations; + SourcePortRanges = sourcePortRanges; + DestinationPortRanges = destinationPortRanges; + Direction = direction; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a friendly name for the rule. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets a description for this rule. + /// + [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' + /// + [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; } + + /// + /// Gets or sets the destination address prefixes. CIDR or destination + /// IP ranges. + /// + [JsonProperty(PropertyName = "properties.destinations")] + public IList Destinations { get; set; } + + /// + /// Gets or sets the source port ranges. + /// + [JsonProperty(PropertyName = "properties.sourcePortRanges")] + public IList SourcePortRanges { get; set; } + + /// + /// Gets or sets the destination port ranges. + /// + [JsonProperty(PropertyName = "properties.destinationPortRanges")] + public IList DestinationPortRanges { get; set; } + + /// + /// 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 security configuration user rule + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Protocol == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); + } + if (Direction == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Direction"); + } + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualHub.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualHub.cs index ceb19131945d..0f7c9234b6e0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualHub.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualHub.cs @@ -73,12 +73,9 @@ public VirtualHub() /// VirtualRouter IPs. /// Flag to control transit /// for VirtualRouter hub. - /// The preferred gateway to - /// route on-prem traffic. Possible values include: 'ExpressRoute', - /// 'VpnGateway', 'None' /// A unique read-only string that changes whenever /// the resource is updated. - 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), long? virtualRouterAsn = default(long?), IList virtualRouterIps = default(IList), bool? allowBranchToBranchTraffic = default(bool?), string preferredRoutingGateway = default(string), string etag = default(string)) + 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), long? virtualRouterAsn = default(long?), IList virtualRouterIps = default(IList), bool? allowBranchToBranchTraffic = default(bool?), string etag = default(string)) : base(id, name, type, location, tags) { VirtualWan = virtualWan; @@ -99,7 +96,6 @@ public VirtualHub() VirtualRouterAsn = virtualRouterAsn; VirtualRouterIps = virtualRouterIps; AllowBranchToBranchTraffic = allowBranchToBranchTraffic; - PreferredRoutingGateway = preferredRoutingGateway; Etag = etag; CustomInit(); } @@ -222,13 +218,6 @@ public VirtualHub() [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' - /// - [JsonProperty(PropertyName = "properties.preferredRoutingGateway")] - public string PreferredRoutingGateway { get; set; } - /// /// Gets a unique read-only string that changes whenever the resource /// is updated. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetwork.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetwork.cs index 6b7af986bcc5..3643f4bb762e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetwork.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetwork.cs @@ -46,8 +46,6 @@ public VirtualNetwork() /// 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 @@ -71,13 +69,12 @@ public VirtualNetwork() /// this VNET. /// 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), IList ipAllocations = default(IList), string etag = default(string)) + 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), 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), IList ipAllocations = default(IList), string etag = default(string)) : base(id, name, type, location, tags) { ExtendedLocation = extendedLocation; AddressSpace = addressSpace; DhcpOptions = dhcpOptions; - FlowTimeoutInMinutes = flowTimeoutInMinutes; Subnets = subnets; VirtualNetworkPeerings = virtualNetworkPeerings; ResourceGuid = resourceGuid; @@ -116,13 +113,6 @@ public VirtualNetwork() [JsonProperty(PropertyName = "properties.dhcpOptions")] public DhcpOptions DhcpOptions { get; set; } - /// - /// Gets or sets the FlowTimeout value (in minutes) for the Virtual - /// Network - /// - [JsonProperty(PropertyName = "properties.flowTimeoutInMinutes")] - public int? FlowTimeoutInMinutes { get; set; } - /// /// Gets or sets a list of subnets in a Virtual Network. /// @@ -199,6 +189,10 @@ public VirtualNetwork() /// public virtual void Validate() { + if (ExtendedLocation != null) + { + ExtendedLocation.Validate(); + } if (VirtualNetworkPeerings != null) { foreach (var element in VirtualNetworkPeerings) diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGateway.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGateway.cs index 7d4dc21f492c..0d055075c65d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGateway.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGateway.cs @@ -39,6 +39,8 @@ public VirtualNetworkGateway() /// Resource type. /// Resource location. /// Resource tags. + /// The extended location of type local + /// virtual network gateway. /// IP configurations for virtual /// network gateway. /// The type of this virtual network gateway. @@ -82,18 +84,12 @@ public VirtualNetworkGateway() /// Customer vnet resource /// id. VirtualNetworkGateway of type local gateway is associated with /// the customer vnet. - /// NatRules for virtual network - /// gateway. - /// EnableBgpRouteTranslationForNat - /// flag. - /// 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), 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?), SubResource gatewayDefaultSite = default(SubResource), VirtualNetworkGatewaySku sku = default(VirtualNetworkGatewaySku), VpnClientConfiguration vpnClientConfiguration = default(VpnClientConfiguration), 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?), ExtendedLocation extendedLocation = default(ExtendedLocation), string etag = default(string)) + public VirtualNetworkGateway(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 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?), SubResource gatewayDefaultSite = default(SubResource), VirtualNetworkGatewaySku sku = default(VirtualNetworkGatewaySku), VpnClientConfiguration vpnClientConfiguration = default(VpnClientConfiguration), 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), string etag = default(string)) : base(id, name, type, location, tags) { + ExtendedLocation = extendedLocation; IpConfigurations = ipConfigurations; GatewayType = gatewayType; VpnType = vpnType; @@ -111,9 +107,6 @@ public VirtualNetworkGateway() EnableDnsForwarding = enableDnsForwarding; InboundDnsForwardingEndpoint = inboundDnsForwardingEndpoint; VNetExtendedLocationResourceId = vNetExtendedLocationResourceId; - NatRules = natRules; - EnableBgpRouteTranslationForNat = enableBgpRouteTranslationForNat; - ExtendedLocation = extendedLocation; Etag = etag; CustomInit(); } @@ -123,6 +116,13 @@ public VirtualNetworkGateway() /// partial void CustomInit(); + /// + /// Gets or sets the extended location of type local virtual network + /// gateway. + /// + [JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation { get; set; } + /// /// Gets or sets IP configurations for virtual network gateway. /// @@ -242,25 +242,6 @@ public VirtualNetworkGateway() [JsonProperty(PropertyName = "properties.vNetExtendedLocationResourceId")] public string VNetExtendedLocationResourceId { get; set; } - /// - /// Gets or sets natRules for virtual network gateway. - /// - [JsonProperty(PropertyName = "properties.natRules")] - public IList NatRules { get; set; } - - /// - /// Gets or sets enableBgpRouteTranslationForNat flag. - /// - [JsonProperty(PropertyName = "properties.enableBgpRouteTranslationForNat")] - public bool? EnableBgpRouteTranslationForNat { get; set; } - - /// - /// Gets or sets the extended location of type local virtual network - /// gateway. - /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } - /// /// Gets a unique read-only string that changes whenever the resource /// is updated. @@ -276,6 +257,10 @@ public VirtualNetworkGateway() /// public virtual void Validate() { + if (ExtendedLocation != null) + { + ExtendedLocation.Validate(); + } if (BgpSettings != null) { BgpSettings.Validate(); diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayConnection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayConnection.cs index 467f31a4a4b3..099f51438b2d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayConnection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayConnection.cs @@ -29,6 +29,7 @@ public partial class VirtualNetworkGatewayConnection : Resource /// public VirtualNetworkGatewayConnection() { + VirtualNetworkGateway1 = new VirtualNetworkGateway(); CustomInit(); } @@ -51,8 +52,6 @@ public VirtualNetworkGatewayConnection() /// 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. @@ -90,15 +89,13 @@ public VirtualNetworkGatewayConnection() /// for data forwarding. /// 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?), 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?), string etag = default(string)) + 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), 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?), 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?), string etag = default(string)) : base(id, name, type, location, tags) { AuthorizationKey = authorizationKey; VirtualNetworkGateway1 = virtualNetworkGateway1; VirtualNetworkGateway2 = virtualNetworkGateway2; LocalNetworkGateway2 = localNetworkGateway2; - IngressNatRules = ingressNatRules; - EgressNatRules = egressNatRules; ConnectionType = connectionType; ConnectionProtocol = connectionProtocol; RoutingWeight = routingWeight; @@ -151,18 +148,6 @@ public VirtualNetworkGatewayConnection() [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; } - - /// - /// Gets or sets list of egress NatRules. - /// - [JsonProperty(PropertyName = "properties.egressNatRules")] - public IList EgressNatRules { get; set; } - /// /// Gets or sets gateway connection type. Possible values include: /// 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayNatRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayNatRule.cs deleted file mode 100644 index f869335babac..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayNatRule.cs +++ /dev/null @@ -1,140 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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] - public partial class VirtualNetworkGatewayNatRule : SubResource - { - /// - /// Initializes a new instance of the VirtualNetworkGatewayNatRule - /// class. - /// - public VirtualNetworkGatewayNatRule() - { - CustomInit(); - } - - /// - /// 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) - { - ProvisioningState = provisioningState; - VirtualNetworkGatewayNatRulePropertiesType = virtualNetworkGatewayNatRulePropertiesType; - Mode = mode; - InternalMappings = internalMappings; - ExternalMappings = externalMappings; - IpConfigurationId = ipConfigurationId; - Name = name; - Etag = etag; - Type = type; - 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' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets or sets the type of NAT rule for VPN NAT. Possible values - /// include: 'Static', 'Dynamic' - /// - [JsonProperty(PropertyName = "properties.type")] - public string VirtualNetworkGatewayNatRulePropertiesType { get; set; } - - /// - /// Gets or sets the Source NAT direction of a VPN NAT. Possible values - /// include: 'EgressSnat', 'IngressSnat' - /// - [JsonProperty(PropertyName = "properties.mode")] - public string Mode { get; set; } - - /// - /// Gets or sets the private IP address internal mapping for NAT. - /// - [JsonProperty(PropertyName = "properties.internalMappings")] - public IList InternalMappings { get; set; } - - /// - /// Gets or sets the private IP address external mapping for NAT. - /// - [JsonProperty(PropertyName = "properties.externalMappings")] - public IList ExternalMappings { get; set; } - - /// - /// Gets or sets the IP Configuration ID this NAT rule applies to. - /// - [JsonProperty(PropertyName = "properties.ipConfigurationId")] - public string IpConfigurationId { 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; } - - /// - /// Gets resource type. - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeering.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeering.cs index 23b92cca42f4..03b45c99a365 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeering.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeering.cs @@ -52,19 +52,13 @@ public VirtualNetworkPeering() /// 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 address space. /// The reference to the remote /// virtual network's Bgp Communities. /// 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' @@ -78,7 +72,7 @@ public VirtualNetworkPeering() /// 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), 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)) + 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), VirtualNetworkBgpCommunities remoteBgpCommunities = default(VirtualNetworkBgpCommunities), string peeringState = 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) { AllowVirtualNetworkAccess = allowVirtualNetworkAccess; @@ -87,10 +81,8 @@ public VirtualNetworkPeering() UseRemoteGateways = useRemoteGateways; RemoteVirtualNetwork = remoteVirtualNetwork; RemoteAddressSpace = remoteAddressSpace; - RemoteVirtualNetworkAddressSpace = remoteVirtualNetworkAddressSpace; RemoteBgpCommunities = remoteBgpCommunities; PeeringState = peeringState; - PeeringSyncLevel = peeringSyncLevel; ProvisioningState = provisioningState; DoNotVerifyRemoteGateways = doNotVerifyRemoteGateways; ResourceGuid = resourceGuid; @@ -148,19 +140,12 @@ public VirtualNetworkPeering() public SubResource RemoteVirtualNetwork { get; set; } /// - /// Gets or sets the reference to the address space peered with the - /// remote virtual network. + /// Gets or sets the reference to the remote virtual network address + /// space. /// [JsonProperty(PropertyName = "properties.remoteAddressSpace")] public AddressSpace RemoteAddressSpace { get; set; } - /// - /// Gets or sets the reference to the current address space of the - /// remote virtual network. - /// - [JsonProperty(PropertyName = "properties.remoteVirtualNetworkAddressSpace")] - public AddressSpace RemoteVirtualNetworkAddressSpace { get; set; } - /// /// Gets or sets the reference to the remote virtual network's Bgp /// Communities. @@ -175,14 +160,6 @@ public VirtualNetworkPeering() [JsonProperty(PropertyName = "properties.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' - /// - [JsonProperty(PropertyName = "properties.peeringSyncLevel")] - public string PeeringSyncLevel { get; set; } - /// /// Gets the provisioning state of the virtual network peering /// resource. Possible values include: 'Succeeded', 'Updating', diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeeringLevel.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeeringLevel.cs deleted file mode 100644 index 4ba41da779d6..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeeringLevel.cs +++ /dev/null @@ -1,24 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 VirtualNetworkPeeringLevel. - /// - public static class VirtualNetworkPeeringLevel - { - public const string FullyInSync = "FullyInSync"; - public const string RemoteNotInSync = "RemoteNotInSync"; - public const string LocalNotInSync = "LocalNotInSync"; - public const string LocalAndRemoteNotInSync = "LocalAndRemoteNotInSync"; - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkTap.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkTap.cs index fae7eacd4bbb..18f6870e7822 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkTap.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkTap.cs @@ -125,5 +125,32 @@ public VirtualNetworkTap() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (NetworkInterfaceTapConfigurations != null) + { + foreach (var element in NetworkInterfaceTapConfigurations) + { + if (element != null) + { + element.Validate(); + } + } + } + if (DestinationNetworkInterfaceIPConfiguration != null) + { + DestinationNetworkInterfaceIPConfiguration.Validate(); + } + if (DestinationLoadBalancerFrontEndIPConfiguration != null) + { + DestinationLoadBalancerFrontEndIPConfiguration.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatGatewaysOperations.cs index 5047308d8922..c0bda7c1d48f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatGatewaysOperations.cs @@ -119,7 +119,7 @@ internal NatGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal NatGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal NatGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -720,7 +720,7 @@ internal NatGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal NatGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1092,7 +1092,7 @@ internal NatGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatRulesOperations.cs index 1c4ba89045ea..f9ca5ba58ff9 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatRulesOperations.cs @@ -101,7 +101,7 @@ internal NatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal NatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,7 +560,7 @@ internal NatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "natRuleParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -785,7 +785,7 @@ internal NatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperations.cs new file mode 100644 index 000000000000..6b2ce397b763 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperations.cs @@ -0,0 +1,1096 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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 + { + /// + /// Initializes a new instance of the NetworkGroupsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal NetworkGroupsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Gets the specified network group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (networkGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkGroupName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new 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); + } + // Construct URL + var _baseUrl = 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("{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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + 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. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + /// + /// 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (networkGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkGroupName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("ifMatch", ifMatch); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("networkGroupName", networkGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = 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("{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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (ifMatch != null) + { + if (_httpRequest.Headers.Contains("If-Match")) + { + _httpRequest.Headers.Remove("If-Match"); + } + _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _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); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a network group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network group to get. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (networkGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkGroupName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new 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, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = 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("{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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _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); + } + return _result; + } + + /// + /// Lists the specified network group. + /// + /// + /// 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new 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); + } + // Construct URL + var _baseUrl = 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new 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('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists the specified network group. + /// + /// + /// The NextLink from the previous successful call to List 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperationsExtensions.cs new file mode 100644 index 000000000000..c3edfff097eb --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperationsExtensions.cs @@ -0,0 +1,270 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// 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 to get. + /// + 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 to get. + /// + /// + /// 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; + } + } + + /// + /// 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 to get. + /// + /// + /// 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)) + { + return operations.CreateOrUpdateAsync(parameters, resourceGroupName, networkManagerName, networkGroupName, 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 to get. + /// + /// + /// 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)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, networkGroupName, ifMatch, null, cancellationToken).ConfigureAwait(false)) + { + 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 to get. + /// + public static void Delete(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName) + { + operations.DeleteAsync(resourceGroupName, networkManagerName, networkGroupName).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 to get. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// 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)) + { + return operations.ListAsync(resourceGroupName, networkManagerName, top, skipToken).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)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// 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/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceIPConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceIPConfigurationsOperations.cs index e48a90a7f76d..98a25fc6ef5d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceIPConfigurationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceIPConfigurationsOperations.cs @@ -94,7 +94,7 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceLoadBalancersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceLoadBalancersOperations.cs index 223c5f6b009d..83172723c07a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceLoadBalancersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceLoadBalancersOperations.cs @@ -94,7 +94,7 @@ internal NetworkInterfaceLoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceTapConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceTapConfigurationsOperations.cs index 0fa75397f9fb..ac57ddc4581e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceTapConfigurationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceTapConfigurationsOperations.cs @@ -126,7 +126,7 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -548,7 +548,7 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -736,11 +736,15 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "tapConfigurationParameters"); } + if (tapConfigurationParameters != null) + { + tapConfigurationParameters.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfacesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfacesOperations.cs index 8768ce7c3190..369b88404652 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfacesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfacesOperations.cs @@ -102,7 +102,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -298,7 +298,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -509,7 +509,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -737,7 +737,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -968,7 +968,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1155,7 +1155,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1338,7 +1338,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2640,7 +2640,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2819,11 +2819,15 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3042,7 +3046,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3236,7 +3240,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagementClient.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagementClient.cs index c1c3a4b3a998..994ea2eaf0b0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagementClient.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagementClient.cs @@ -303,6 +303,101 @@ public partial class NetworkManagementClient : ServiceClient public virtual INetworkInterfaceTapConfigurationsOperations NetworkInterfaceTapConfigurations { get; private set; } + /// + /// Gets the INetworkManagersOperations. + /// + public virtual INetworkManagersOperations NetworkManagers { get; private set; } + + /// + /// Gets the INetworkManagerCommitsOperations. + /// + public virtual INetworkManagerCommitsOperations NetworkManagerCommits { get; private set; } + + /// + /// Gets the INetworkManagerDeploymentStatusOperations. + /// + public virtual INetworkManagerDeploymentStatusOperations NetworkManagerDeploymentStatus { get; private set; } + + /// + /// Gets the IEffectiveVirtualNetworksOperations. + /// + public virtual IEffectiveVirtualNetworksOperations EffectiveVirtualNetworks { get; private set; } + + /// + /// Gets the IActiveConnectivityConfigurationsOperations. + /// + public virtual IActiveConnectivityConfigurationsOperations ActiveConnectivityConfigurations { get; private set; } + + /// + /// Gets the IActiveSecurityAdminRulesOperations. + /// + public virtual IActiveSecurityAdminRulesOperations ActiveSecurityAdminRules { get; private set; } + + /// + /// Gets the IActiveSecurityUserRulesOperations. + /// + public virtual IActiveSecurityUserRulesOperations ActiveSecurityUserRules { get; private set; } + + /// + /// Gets the IConnectivityConfigurationsOperations. + /// + public virtual IConnectivityConfigurationsOperations ConnectivityConfigurations { get; private set; } + + /// + /// Gets the IEffectiveConnectivityConfigurationsOperations. + /// + public virtual IEffectiveConnectivityConfigurationsOperations EffectiveConnectivityConfigurations { get; private set; } + + /// + /// Gets the INetworkManagerEffectiveSecurityAdminRulesOperations. + /// + public virtual INetworkManagerEffectiveSecurityAdminRulesOperations NetworkManagerEffectiveSecurityAdminRules { get; private set; } + + /// + /// Gets the INetworkGroupsOperations. + /// + public virtual INetworkGroupsOperations NetworkGroups { get; private set; } + + /// + /// Gets the ISecurityUserConfigurationsOperations. + /// + public virtual ISecurityUserConfigurationsOperations SecurityUserConfigurations { get; private set; } + + /// + /// Gets the IUserRuleCollectionsOperations. + /// + public virtual IUserRuleCollectionsOperations UserRuleCollections { get; private set; } + + /// + /// Gets the IUserRulesOperations. + /// + public virtual IUserRulesOperations UserRules { get; private set; } + + /// + /// Gets the ISecurityAdminConfigurationsOperations. + /// + public virtual ISecurityAdminConfigurationsOperations SecurityAdminConfigurations { get; private set; } + + /// + /// Gets the IAdminRuleCollectionsOperations. + /// + public virtual IAdminRuleCollectionsOperations AdminRuleCollections { get; private set; } + + /// + /// Gets the IAdminRulesOperations. + /// + public virtual IAdminRulesOperations AdminRules { get; private set; } + + /// + /// Gets the INetworkSecurityPerimetersOperations. + /// + public virtual INetworkSecurityPerimetersOperations NetworkSecurityPerimeters { get; private set; } + + /// + /// Gets the IPerimeterAssociableResourceTypesOperations. + /// + public virtual IPerimeterAssociableResourceTypesOperations PerimeterAssociableResourceTypes { get; private set; } + /// /// Gets the INetworkProfilesOperations. /// @@ -483,11 +578,6 @@ public partial class NetworkManagementClient : ServiceClient public virtual ILocalNetworkGatewaysOperations LocalNetworkGateways { get; private set; } - /// - /// Gets the IVirtualNetworkGatewayNatRulesOperations. - /// - public virtual IVirtualNetworkGatewayNatRulesOperations VirtualNetworkGatewayNatRules { get; private set; } - /// /// Gets the IVirtualNetworkTapsOperations. /// @@ -899,6 +989,25 @@ private void Initialize() NetworkInterfaceIPConfigurations = new NetworkInterfaceIPConfigurationsOperations(this); NetworkInterfaceLoadBalancers = new NetworkInterfaceLoadBalancersOperations(this); NetworkInterfaceTapConfigurations = new NetworkInterfaceTapConfigurationsOperations(this); + NetworkManagers = new NetworkManagersOperations(this); + NetworkManagerCommits = new NetworkManagerCommitsOperations(this); + NetworkManagerDeploymentStatus = new NetworkManagerDeploymentStatusOperations(this); + EffectiveVirtualNetworks = new EffectiveVirtualNetworksOperations(this); + ActiveConnectivityConfigurations = new ActiveConnectivityConfigurationsOperations(this); + ActiveSecurityAdminRules = new ActiveSecurityAdminRulesOperations(this); + ActiveSecurityUserRules = new ActiveSecurityUserRulesOperations(this); + ConnectivityConfigurations = new ConnectivityConfigurationsOperations(this); + EffectiveConnectivityConfigurations = new EffectiveConnectivityConfigurationsOperations(this); + NetworkManagerEffectiveSecurityAdminRules = new NetworkManagerEffectiveSecurityAdminRulesOperations(this); + NetworkGroups = new NetworkGroupsOperations(this); + SecurityUserConfigurations = new SecurityUserConfigurationsOperations(this); + UserRuleCollections = new UserRuleCollectionsOperations(this); + UserRules = new UserRulesOperations(this); + SecurityAdminConfigurations = new SecurityAdminConfigurationsOperations(this); + AdminRuleCollections = new AdminRuleCollectionsOperations(this); + AdminRules = new AdminRulesOperations(this); + NetworkSecurityPerimeters = new NetworkSecurityPerimetersOperations(this); + PerimeterAssociableResourceTypes = new PerimeterAssociableResourceTypesOperations(this); NetworkProfiles = new NetworkProfilesOperations(this); NetworkSecurityGroups = new NetworkSecurityGroupsOperations(this); SecurityRules = new SecurityRulesOperations(this); @@ -935,7 +1044,6 @@ private void Initialize() 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); @@ -995,6 +1103,16 @@ private void Initialize() 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 PolymorphicSerializeJsonConverter("kind")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); @@ -1102,7 +1220,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "bslRequest"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1332,7 +1450,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "sessionIds"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1535,7 +1653,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1733,7 +1851,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1963,7 +2081,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "bslRequest"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2169,7 +2287,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "bslRequest"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2352,7 +2470,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2557,7 +2675,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "vpnClientParams"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperations.cs new file mode 100644 index 000000000000..48a740a23c13 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperations.cs @@ -0,0 +1,262 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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 + { + /// + /// Initializes a new instance of the NetworkManagerCommitsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal NetworkManagerCommitsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PostWithHttpMessagesAsync(NetworkManagerCommit parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Post", tracingParameters); + } + // Construct URL + var _baseUrl = 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _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); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperationsExtensions.cs new file mode 100644 index 000000000000..35f1b26a59e6 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperationsExtensions.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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// 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. + /// + /// + /// 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)) + { + using (var _result = await operations.PostWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerDeploymentStatusOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerDeploymentStatusOperations.cs new file mode 100644 index 000000000000..f078bf5cfe9b --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerDeploymentStatusOperations.cs @@ -0,0 +1,262 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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 + { + /// + /// Initializes a new instance of the NetworkManagerDeploymentStatusOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal NetworkManagerDeploymentStatusOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Post to List of Network Manager Deployment Status. + /// + /// + /// Parameters supplied to specify which Managed Network deployment status is. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListWithHttpMessagesAsync(NetworkManagerDeploymentStatusParameter parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _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); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerDeploymentStatusOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerDeploymentStatusOperationsExtensions.cs new file mode 100644 index 000000000000..e5c36f86ffe3 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerDeploymentStatusOperationsExtensions.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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// 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. + /// + public static NetworkManagerDeploymentStatusListResult List(this INetworkManagerDeploymentStatusOperations operations, NetworkManagerDeploymentStatusParameter parameters, string resourceGroupName, string networkManagerName) + { + return operations.ListAsync(parameters, resourceGroupName, networkManagerName).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. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this INetworkManagerDeploymentStatusOperations operations, NetworkManagerDeploymentStatusParameter parameters, string resourceGroupName, string networkManagerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerEffectiveSecurityAdminRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerEffectiveSecurityAdminRulesOperations.cs new file mode 100644 index 000000000000..0aaed7494ff9 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerEffectiveSecurityAdminRulesOperations.cs @@ -0,0 +1,262 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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; + + /// + /// NetworkManagerEffectiveSecurityAdminRulesOperations operations. + /// + internal partial class NetworkManagerEffectiveSecurityAdminRulesOperations : IServiceOperations, INetworkManagerEffectiveSecurityAdminRulesOperations + { + /// + /// Initializes a new instance of the NetworkManagerEffectiveSecurityAdminRulesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal NetworkManagerEffectiveSecurityAdminRulesOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// List all effective security admin rules applied on a virtual network. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the virtual network. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (virtualNetworkName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("virtualNetworkName", virtualNetworkName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.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(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _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); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerEffectiveSecurityAdminRulesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerEffectiveSecurityAdminRulesOperationsExtensions.cs new file mode 100644 index 000000000000..d1e4f7243c37 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerEffectiveSecurityAdminRulesOperationsExtensions.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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for NetworkManagerEffectiveSecurityAdminRulesOperations. + /// + public static partial class NetworkManagerEffectiveSecurityAdminRulesOperationsExtensions + { + /// + /// 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. + /// + /// + /// Parameters supplied to list correct page. + /// + public static NetworkManagerEffectiveSecurityAdminRulesListResult List(this INetworkManagerEffectiveSecurityAdminRulesOperations operations, string resourceGroupName, string virtualNetworkName, object parameters) + { + return operations.ListAsync(resourceGroupName, virtualNetworkName, parameters).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. + /// + /// + /// Parameters supplied to list correct page. + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this INetworkManagerEffectiveSecurityAdminRulesOperations operations, string resourceGroupName, string virtualNetworkName, object parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperations.cs new file mode 100644 index 000000000000..35b89b579654 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperations.cs @@ -0,0 +1,1618 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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 + { + /// + /// Initializes a new instance of the NetworkManagersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal NetworkManagersOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Gets the specified Network Manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _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); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a network manager. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _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); + } + return _result; + } + + /// + /// Patch a NetworkManager Tags. + /// + /// + /// Parameters supplied to update network manager tags. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> PatchTagsWithHttpMessagesAsync(TagsObject parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "PatchTags", tracingParameters); + } + // Construct URL + var _baseUrl = 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _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); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List all network managers in a subscription. + /// + /// + /// 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("top", top); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + } + // Construct URL + var _baseUrl = 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(); + 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('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// 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. + /// + /// + /// 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new 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); + } + // Construct URL + var _baseUrl = 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new 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('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List all network managers in a subscription. + /// + /// + /// The NextLink from the previous successful call to List 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List network managers in a resource group. + /// + /// + /// The NextLink from the previous successful call to List 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperationsExtensions.cs new file mode 100644 index 000000000000..496cd644173f --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperationsExtensions.cs @@ -0,0 +1,364 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// 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. + /// + public static void Delete(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName) + { + operations.DeleteAsync(resourceGroupName, networkManagerName).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. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Patch a NetworkManager Tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to update network manager tags. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + public static NetworkManager PatchTags(this INetworkManagersOperations operations, TagsObject parameters, string resourceGroupName, string networkManagerName) + { + return operations.PatchTagsAsync(parameters, resourceGroupName, networkManagerName).GetAwaiter().GetResult(); + } + + /// + /// Patch a NetworkManager Tags. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameters supplied to update network manager tags. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The cancellation token. + /// + public static async Task PatchTagsAsync(this INetworkManagersOperations operations, TagsObject parameters, string resourceGroupName, string networkManagerName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.PatchTagsWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)) + { + 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 IPage ListBySubscription(this INetworkManagersOperations operations, int? top = default(int?), string skipToken = default(string)) + { + return operations.ListBySubscriptionAsync(top, skipToken).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)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + 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 IPage List(this INetworkManagersOperations operations, string resourceGroupName, int? top = default(int?), string skipToken = default(string)) + { + return operations.ListAsync(resourceGroupName, 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)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// 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) + { + return 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. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionNextAsync(this INetworkManagersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + 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/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkProfilesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkProfilesOperations.cs index 73b5fc667814..65963ff53836 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkProfilesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkProfilesOperations.cs @@ -119,7 +119,7 @@ internal NetworkProfilesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -325,7 +325,7 @@ internal NetworkProfilesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -551,7 +551,7 @@ internal NetworkProfilesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -738,7 +738,7 @@ internal NetworkProfilesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -921,7 +921,7 @@ internal NetworkProfilesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1110,7 +1110,7 @@ internal NetworkProfilesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityGroupsOperations.cs index 7c9566158d07..775ed12380a2 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityGroupsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityGroupsOperations.cs @@ -119,7 +119,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -352,7 +352,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -539,7 +539,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -722,7 +722,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -911,7 +911,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1096,7 +1096,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperations.cs new file mode 100644 index 000000000000..534607527ec1 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperations.cs @@ -0,0 +1,1410 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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; + + /// + /// NetworkSecurityPerimetersOperations operations. + /// + internal partial class NetworkSecurityPerimetersOperations : IServiceOperations, INetworkSecurityPerimetersOperations + { + /// + /// Initializes a new instance of the NetworkSecurityPerimetersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal NetworkSecurityPerimetersOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Gets the specified network security perimeter by the name. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security perimeter. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityPerimeterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkSecurityPerimeterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityPerimeterName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkSecurityPerimeterName", networkSecurityPerimeterName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityPerimeterName}", System.Uri.EscapeDataString(networkSecurityPerimeterName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a Network Security Perimeter. + /// + /// + /// Parameter supplied to create or update the network security perimeter. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security perimeter. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(NetworkSecurityPerimeter parameters, string resourceGroupName, string networkSecurityPerimeterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkSecurityPerimeterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityPerimeterName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkSecurityPerimeterName", networkSecurityPerimeterName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityPerimeterName}", System.Uri.EscapeDataString(networkSecurityPerimeterName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _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); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a network security perimeter. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security perimeter. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityPerimeterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkSecurityPerimeterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityPerimeterName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkSecurityPerimeterName", networkSecurityPerimeterName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkSecurityPerimeterName}", System.Uri.EscapeDataString(networkSecurityPerimeterName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _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); + } + return _result; + } + + /// + /// List all network security perimeters in a subscription. + /// + /// + /// 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("top", top); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityPerimeters").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new 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('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List network security perimeters 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. + /// + /// + /// 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new 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); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new 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('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List all network security perimeters in a subscription. + /// + /// + /// The NextLink from the previous successful call to List 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List network security perimeters in a resource group. + /// + /// + /// The NextLink from the previous successful call to List 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperationsExtensions.cs new file mode 100644 index 000000000000..d7d7cc00d8b1 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperationsExtensions.cs @@ -0,0 +1,318 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for NetworkSecurityPerimetersOperations. + /// + public static partial class NetworkSecurityPerimetersOperationsExtensions + { + /// + /// Gets the specified network security perimeter by the name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security perimeter. + /// + public static NetworkSecurityPerimeter Get(this INetworkSecurityPerimetersOperations operations, string resourceGroupName, string networkSecurityPerimeterName) + { + return operations.GetAsync(resourceGroupName, networkSecurityPerimeterName).GetAwaiter().GetResult(); + } + + /// + /// Gets the specified network security perimeter by the name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security perimeter. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this INetworkSecurityPerimetersOperations operations, string resourceGroupName, string networkSecurityPerimeterName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkSecurityPerimeterName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a Network Security Perimeter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameter supplied to create or update the network security perimeter. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security perimeter. + /// + public static NetworkSecurityPerimeter CreateOrUpdate(this INetworkSecurityPerimetersOperations operations, NetworkSecurityPerimeter parameters, string resourceGroupName, string networkSecurityPerimeterName) + { + return operations.CreateOrUpdateAsync(parameters, resourceGroupName, networkSecurityPerimeterName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Network Security Perimeter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Parameter supplied to create or update the network security perimeter. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security perimeter. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this INetworkSecurityPerimetersOperations operations, NetworkSecurityPerimeter parameters, string resourceGroupName, string networkSecurityPerimeterName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(parameters, resourceGroupName, networkSecurityPerimeterName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a network security perimeter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security perimeter. + /// + public static void Delete(this INetworkSecurityPerimetersOperations operations, string resourceGroupName, string networkSecurityPerimeterName) + { + operations.DeleteAsync(resourceGroupName, networkSecurityPerimeterName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a network security perimeter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network security perimeter. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this INetworkSecurityPerimetersOperations operations, string resourceGroupName, string networkSecurityPerimeterName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityPerimeterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// List all network security perimeters 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 INetworkSecurityPerimetersOperations operations, int? top = default(int?), string skipToken = default(string)) + { + return operations.ListBySubscriptionAsync(top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// List all network security perimeters 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 INetworkSecurityPerimetersOperations operations, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List network security perimeters 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 INetworkSecurityPerimetersOperations operations, string resourceGroupName, int? top = default(int?), string skipToken = default(string)) + { + return operations.ListAsync(resourceGroupName, top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// List network security perimeters 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 INetworkSecurityPerimetersOperations operations, string resourceGroupName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all network security perimeters 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 INetworkSecurityPerimetersOperations operations, string nextPageLink) + { + return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all network security perimeters 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 INetworkSecurityPerimetersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List network security perimeters 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 INetworkSecurityPerimetersOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List network security perimeters 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 INetworkSecurityPerimetersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkVirtualAppliancesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkVirtualAppliancesOperations.cs index a58411d73f9b..88f8a92542c6 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkVirtualAppliancesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkVirtualAppliancesOperations.cs @@ -119,7 +119,7 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -325,7 +325,7 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -544,7 +544,7 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -722,7 +722,7 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1096,7 +1096,7 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkWatchersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkWatchersOperations.cs index df9c8e8763b8..38264005c714 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkWatchersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkWatchersOperations.cs @@ -101,7 +101,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -315,7 +315,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -533,7 +533,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -722,7 +722,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -895,7 +895,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1087,7 +1087,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1571,7 +1571,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1754,7 +1754,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1979,7 +1979,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2204,7 +2204,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2429,7 +2429,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2654,7 +2654,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2880,7 +2880,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3107,7 +3107,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3334,7 +3334,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3561,7 +3561,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3784,7 +3784,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4015,7 +4015,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Operations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Operations.cs index ef83ab22ca71..299057dabd84 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Operations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Operations.cs @@ -70,7 +70,7 @@ internal Operations(NetworkManagementClient client) /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/P2sVpnGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/P2sVpnGatewaysOperations.cs index befd48a49a54..1289afa50d22 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/P2sVpnGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/P2sVpnGatewaysOperations.cs @@ -94,7 +94,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -354,7 +354,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -532,7 +532,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -854,7 +854,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "p2SVpnGatewayParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1080,7 +1080,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "p2SVpnGatewayParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1278,7 +1278,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1454,7 +1454,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1657,7 +1657,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1859,7 +1859,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2061,7 +2061,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "request"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2267,7 +2267,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "request"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PacketCapturesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PacketCapturesOperations.cs index 009646758e72..05fd5906fd7d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PacketCapturesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PacketCapturesOperations.cs @@ -129,7 +129,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -395,7 +395,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -602,7 +602,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -804,7 +804,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -981,7 +981,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1161,7 +1161,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PeerExpressRouteCircuitConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PeerExpressRouteCircuitConnectionsOperations.cs index 2225543ad01f..d43a7a8e7365 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PeerExpressRouteCircuitConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PeerExpressRouteCircuitConnectionsOperations.cs @@ -109,7 +109,7 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -315,7 +315,7 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperations.cs new file mode 100644 index 000000000000..769ce24d4b09 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperations.cs @@ -0,0 +1,240 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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; + + /// + /// PerimeterAssociableResourceTypesOperations operations. + /// + internal partial class PerimeterAssociableResourceTypesOperations : IServiceOperations, IPerimeterAssociableResourceTypesOperations + { + /// + /// Initializes a new instance of the PerimeterAssociableResourceTypesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal PerimeterAssociableResourceTypesOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Gets the list of resources that are onboarded with NSP. These resources can + /// be associated with a network security perimeter + /// + /// + /// The location of the where the association is present. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/perimeterAssociableResourceTypes").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperationsExtensions.cs new file mode 100644 index 000000000000..9b60f7b572b9 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperationsExtensions.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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for PerimeterAssociableResourceTypesOperations. + /// + public static partial class PerimeterAssociableResourceTypesOperationsExtensions + { + /// + /// Gets the list of resources that are onboarded with NSP. These resources can + /// be associated with a network security perimeter + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the where the association is present. + /// + public static PerimeterAssociableResourcesListResult Get(this IPerimeterAssociableResourceTypesOperations operations, string location) + { + return operations.GetAsync(location).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of resources that are onboarded with NSP. These resources can + /// be associated with a network security perimeter + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the where the association is present. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IPerimeterAssociableResourceTypesOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateDnsZoneGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateDnsZoneGroupsOperations.cs index c60d36c32fed..8b98c61ef4e1 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateDnsZoneGroupsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateDnsZoneGroupsOperations.cs @@ -127,7 +127,7 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -353,7 +353,7 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -546,7 +546,7 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -740,7 +740,7 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateEndpointsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateEndpointsOperations.cs index 6a06e26e8be6..021b83888e81 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateEndpointsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateEndpointsOperations.cs @@ -119,7 +119,7 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -331,7 +331,7 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -504,7 +504,7 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -686,7 +686,7 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -860,11 +860,15 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateLinkServicesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateLinkServicesOperations.cs index abdd8399e42d..21734e8da396 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateLinkServicesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateLinkServicesOperations.cs @@ -119,7 +119,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -331,7 +331,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -504,7 +504,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -700,7 +700,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -907,11 +907,15 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1135,7 +1139,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1366,7 +1370,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1559,7 +1563,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1750,7 +1754,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1924,11 +1928,15 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2147,7 +2155,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2320,7 +2328,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2527,7 +2535,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPPrefixesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPPrefixesOperations.cs index 63883ffdea67..dc38cc3f1d64 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPPrefixesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPPrefixesOperations.cs @@ -119,7 +119,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -720,7 +720,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1088,11 +1088,15 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperations.cs index c4a05c889a6a..c265be1086b8 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperations.cs @@ -94,7 +94,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -310,7 +310,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -541,7 +541,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -773,7 +773,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1004,7 +1004,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1191,7 +1191,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1374,7 +1374,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2218,7 +2218,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2397,11 +2397,15 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ResourceNavigationLinksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ResourceNavigationLinksOperations.cs index 304cb0c019c0..c25d53ab6ef8 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ResourceNavigationLinksOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ResourceNavigationLinksOperations.cs @@ -101,7 +101,7 @@ internal ResourceNavigationLinksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFilterRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFilterRulesOperations.cs index ae78dd7c205a..27c88f37e919 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFilterRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFilterRulesOperations.cs @@ -126,7 +126,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -548,7 +548,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -744,7 +744,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFiltersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFiltersOperations.cs index c24feb97191d..ea4e5f2f4187 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFiltersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFiltersOperations.cs @@ -119,7 +119,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -544,7 +544,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -722,7 +722,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1092,7 +1092,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteTablesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteTablesOperations.cs index bb44a08db3fb..d9d70170100b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteTablesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteTablesOperations.cs @@ -119,7 +119,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -544,7 +544,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -722,7 +722,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1092,7 +1092,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RoutesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RoutesOperations.cs index 859fa569b081..a05e63697750 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RoutesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RoutesOperations.cs @@ -126,7 +126,7 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -548,7 +548,7 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -744,7 +744,7 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SdkInfo_NetworkManagementClient.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SdkInfo_NetworkManagementClient.cs index 277062fb225a..eae8ba3a9017 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SdkInfo_NetworkManagementClient.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SdkInfo_NetworkManagementClient.cs @@ -20,138 +20,145 @@ public static IEnumerable> ApiInfo_NetworkManageme return new Tuple[] { new Tuple("Compute", "NetworkInterfaces", "2018-10-01"), - new Tuple("Compute", "NetworkInterfaces", "2021-02-01"), + new Tuple("Compute", "NetworkInterfaces", "2020-11-01"), new Tuple("Compute", "PublicIPAddresses", "2018-10-01"), - new Tuple("Compute", "PublicIPAddresses", "2021-02-01"), - new Tuple("Network", "ApplicationGatewayPrivateEndpointConnections", "2021-02-01"), - new Tuple("Network", "ApplicationGatewayPrivateLinkResources", "2021-02-01"), - new Tuple("Network", "ApplicationGateways", "2021-02-01"), - new Tuple("Network", "ApplicationSecurityGroups", "2021-02-01"), - new Tuple("Network", "AvailableDelegations", "2021-02-01"), - new Tuple("Network", "AvailableEndpointServices", "2021-02-01"), - new Tuple("Network", "AvailablePrivateEndpointTypes", "2021-02-01"), - new Tuple("Network", "AvailableResourceGroupDelegations", "2021-02-01"), - new Tuple("Network", "AvailableServiceAliases", "2021-02-01"), - new Tuple("Network", "AzureFirewallFqdnTags", "2021-02-01"), - new Tuple("Network", "AzureFirewalls", "2021-02-01"), - new Tuple("Network", "BastionHosts", "2021-02-01"), - new Tuple("Network", "BgpServiceCommunities", "2021-02-01"), - new Tuple("Network", "CheckDnsNameAvailability", "2021-02-01"), - new Tuple("Network", "ConnectionMonitors", "2021-02-01"), - new Tuple("Network", "CustomIPPrefixes", "2021-02-01"), - new Tuple("Network", "DdosCustomPolicies", "2021-02-01"), - new Tuple("Network", "DdosProtectionPlans", "2021-02-01"), - new Tuple("Network", "DefaultSecurityRules", "2021-02-01"), - new Tuple("Network", "DeleteBastionShareableLink", "2021-02-01"), - new Tuple("Network", "DisconnectActiveSessions", "2021-02-01"), - new Tuple("Network", "DscpConfiguration", "2021-02-01"), - new Tuple("Network", "ExpressRouteCircuitAuthorizations", "2021-02-01"), - new Tuple("Network", "ExpressRouteCircuitConnections", "2021-02-01"), - new Tuple("Network", "ExpressRouteCircuitPeerings", "2021-02-01"), - new Tuple("Network", "ExpressRouteCircuits", "2021-02-01"), - new Tuple("Network", "ExpressRouteConnections", "2021-02-01"), - new Tuple("Network", "ExpressRouteCrossConnectionPeerings", "2021-02-01"), - new Tuple("Network", "ExpressRouteCrossConnections", "2021-02-01"), - new Tuple("Network", "ExpressRouteGateways", "2021-02-01"), - new Tuple("Network", "ExpressRouteLinks", "2021-02-01"), - new Tuple("Network", "ExpressRoutePorts", "2021-02-01"), - new Tuple("Network", "ExpressRoutePortsLocations", "2021-02-01"), - new Tuple("Network", "ExpressRouteServiceProviders", "2021-02-01"), - new Tuple("Network", "FirewallPolicies", "2021-02-01"), - new Tuple("Network", "FirewallPolicyRuleCollectionGroups", "2021-02-01"), - new Tuple("Network", "FlowLogs", "2021-02-01"), - new Tuple("Network", "GetActiveSessions", "2021-02-01"), - new Tuple("Network", "GetBastionShareableLink", "2021-02-01"), - new Tuple("Network", "HubRouteTables", "2021-02-01"), - new Tuple("Network", "HubVirtualNetworkConnections", "2021-02-01"), - new Tuple("Network", "InboundNatRules", "2021-02-01"), - new Tuple("Network", "InboundSecurityRule", "2021-02-01"), - new Tuple("Network", "IpAllocations", "2021-02-01"), - new Tuple("Network", "IpGroups", "2021-02-01"), - new Tuple("Network", "LoadBalancerBackendAddressPools", "2021-02-01"), - new Tuple("Network", "LoadBalancerFrontendIPConfigurations", "2021-02-01"), - new Tuple("Network", "LoadBalancerLoadBalancingRules", "2021-02-01"), - new Tuple("Network", "LoadBalancerNetworkInterfaces", "2021-02-01"), - new Tuple("Network", "LoadBalancerOutboundRules", "2021-02-01"), - new Tuple("Network", "LoadBalancerProbes", "2021-02-01"), - new Tuple("Network", "LoadBalancers", "2021-02-01"), - new Tuple("Network", "LocalNetworkGateways", "2021-02-01"), - new Tuple("Network", "NatGateways", "2021-02-01"), - new Tuple("Network", "NatRules", "2021-02-01"), - new Tuple("Network", "NetworkInterfaceIPConfigurations", "2021-02-01"), - new Tuple("Network", "NetworkInterfaceLoadBalancers", "2021-02-01"), - new Tuple("Network", "NetworkInterfaceTapConfigurations", "2021-02-01"), - new Tuple("Network", "NetworkInterfaces", "2021-02-01"), - new Tuple("Network", "NetworkProfiles", "2021-02-01"), - new Tuple("Network", "NetworkSecurityGroups", "2021-02-01"), - new Tuple("Network", "NetworkVirtualAppliances", "2021-02-01"), - new Tuple("Network", "NetworkWatchers", "2021-02-01"), - new Tuple("Network", "Operations", "2021-02-01"), - new Tuple("Network", "P2SVpnGateways", "2021-02-01"), - new Tuple("Network", "P2sVpnGateways", "2021-02-01"), - new Tuple("Network", "PacketCaptures", "2021-02-01"), - new Tuple("Network", "PeerExpressRouteCircuitConnections", "2021-02-01"), - new Tuple("Network", "PrivateDnsZoneGroups", "2021-02-01"), - new Tuple("Network", "PrivateEndpoints", "2021-02-01"), - new Tuple("Network", "PrivateLinkServices", "2021-02-01"), - new Tuple("Network", "PublicIPAddresses", "2021-02-01"), - new Tuple("Network", "PublicIPPrefixes", "2021-02-01"), - new Tuple("Network", "PutBastionShareableLink", "2021-02-01"), - new Tuple("Network", "ResourceNavigationLinks", "2021-02-01"), - new Tuple("Network", "RouteFilterRules", "2021-02-01"), - new Tuple("Network", "RouteFilters", "2021-02-01"), - new Tuple("Network", "RouteTables", "2021-02-01"), - new Tuple("Network", "Routes", "2021-02-01"), - new Tuple("Network", "SecurityPartnerProviders", "2021-02-01"), - new Tuple("Network", "SecurityRules", "2021-02-01"), - new Tuple("Network", "ServiceAssociationLinks", "2021-02-01"), - new Tuple("Network", "ServiceEndpointPolicies", "2021-02-01"), - new Tuple("Network", "ServiceEndpointPolicyDefinitions", "2021-02-01"), - new Tuple("Network", "ServiceTags", "2021-02-01"), - new Tuple("Network", "Subnets", "2021-02-01"), - new Tuple("Network", "SupportedSecurityProviders", "2021-02-01"), - new Tuple("Network", "Usages", "2021-02-01"), - new Tuple("Network", "VirtualApplianceSites", "2021-02-01"), - new Tuple("Network", "VirtualApplianceSkus", "2021-02-01"), - new Tuple("Network", "VirtualHubBgpConnection", "2021-02-01"), - new Tuple("Network", "VirtualHubBgpConnections", "2021-02-01"), - new Tuple("Network", "VirtualHubIpConfiguration", "2021-02-01"), - new Tuple("Network", "VirtualHubRouteTableV2s", "2021-02-01"), - new Tuple("Network", "VirtualHubs", "2021-02-01"), - new Tuple("Network", "VirtualNetworkGatewayConnections", "2021-02-01"), - new Tuple("Network", "VirtualNetworkGatewayNatRules", "2021-02-01"), - new Tuple("Network", "VirtualNetworkGateways", "2021-02-01"), - new Tuple("Network", "VirtualNetworkPeerings", "2021-02-01"), - new Tuple("Network", "VirtualNetworkTaps", "2021-02-01"), - new Tuple("Network", "VirtualNetworks", "2021-02-01"), - new Tuple("Network", "VirtualRouterPeerings", "2021-02-01"), - new Tuple("Network", "VirtualRouters", "2021-02-01"), - new Tuple("Network", "VirtualWans", "2021-02-01"), - new Tuple("Network", "VpnConnections", "2021-02-01"), - new Tuple("Network", "VpnGateways", "2021-02-01"), - new Tuple("Network", "VpnLinkConnections", "2021-02-01"), - new Tuple("Network", "VpnServerConfigurations", "2021-02-01"), - new Tuple("Network", "VpnServerConfigurationsAssociatedWithVirtualWan", "2021-02-01"), - new Tuple("Network", "VpnSiteLinkConnections", "2021-02-01"), - new Tuple("Network", "VpnSiteLinks", "2021-02-01"), - new Tuple("Network", "VpnSites", "2021-02-01"), - new Tuple("Network", "VpnSitesConfiguration", "2021-02-01"), - new Tuple("Network", "WebApplicationFirewallPolicies", "2021-02-01"), - new Tuple("Network", "WebCategories", "2021-02-01"), - new Tuple("Network", "generatevirtualwanvpnserverconfigurationvpnprofile", "2021-02-01"), + new Tuple("Compute", "PublicIPAddresses", "2020-11-01"), + new Tuple("Network", "ActiveConnectivityConfigurations", "2021-02-01-preview"), + new Tuple("Network", "ActiveSecurityAdminRules", "2021-02-01-preview"), + new Tuple("Network", "ActiveSecurityUserRules", "2021-02-01-preview"), + new Tuple("Network", "AdminRuleCollections", "2021-02-01-preview"), + new Tuple("Network", "AdminRules", "2021-02-01-preview"), + new Tuple("Network", "ApplicationGatewayPrivateEndpointConnections", "2020-11-01"), + new Tuple("Network", "ApplicationGatewayPrivateLinkResources", "2020-11-01"), + new Tuple("Network", "ApplicationGateways", "2020-11-01"), + new Tuple("Network", "ApplicationSecurityGroups", "2020-11-01"), + new Tuple("Network", "AvailableDelegations", "2020-11-01"), + new Tuple("Network", "AvailableEndpointServices", "2020-11-01"), + new Tuple("Network", "AvailablePrivateEndpointTypes", "2020-11-01"), + new Tuple("Network", "AvailableResourceGroupDelegations", "2020-11-01"), + new Tuple("Network", "AvailableServiceAliases", "2020-11-01"), + new Tuple("Network", "AzureFirewallFqdnTags", "2020-11-01"), + new Tuple("Network", "AzureFirewalls", "2020-11-01"), + new Tuple("Network", "BastionHosts", "2020-11-01"), + new Tuple("Network", "BgpServiceCommunities", "2020-11-01"), + new Tuple("Network", "CheckDnsNameAvailability", "2020-11-01"), + new Tuple("Network", "ConnectionMonitors", "2020-11-01"), + new Tuple("Network", "ConnectivityConfigurations", "2021-02-01-preview"), + new Tuple("Network", "CustomIPPrefixes", "2020-11-01"), + new Tuple("Network", "DdosCustomPolicies", "2020-11-01"), + new Tuple("Network", "DdosProtectionPlans", "2020-11-01"), + new Tuple("Network", "DefaultSecurityRules", "2020-11-01"), + new Tuple("Network", "DeleteBastionShareableLink", "2020-11-01"), + new Tuple("Network", "DisconnectActiveSessions", "2020-11-01"), + new Tuple("Network", "DscpConfiguration", "2020-11-01"), + new Tuple("Network", "EffectiveConnectivityConfigurations", "2021-02-01-preview"), + new Tuple("Network", "EffectiveVirtualNetworks", "2021-02-01-preview"), + new Tuple("Network", "ExpressRouteCircuitAuthorizations", "2020-11-01"), + new Tuple("Network", "ExpressRouteCircuitConnections", "2020-11-01"), + new Tuple("Network", "ExpressRouteCircuitPeerings", "2020-11-01"), + new Tuple("Network", "ExpressRouteCircuits", "2020-11-01"), + new Tuple("Network", "ExpressRouteConnections", "2020-11-01"), + new Tuple("Network", "ExpressRouteCrossConnectionPeerings", "2020-11-01"), + new Tuple("Network", "ExpressRouteCrossConnections", "2020-11-01"), + new Tuple("Network", "ExpressRouteGateways", "2020-11-01"), + new Tuple("Network", "ExpressRouteLinks", "2020-11-01"), + new Tuple("Network", "ExpressRoutePorts", "2020-11-01"), + new Tuple("Network", "ExpressRoutePortsLocations", "2020-11-01"), + new Tuple("Network", "ExpressRouteServiceProviders", "2020-11-01"), + new Tuple("Network", "FirewallPolicies", "2020-11-01"), + new Tuple("Network", "FirewallPolicyRuleCollectionGroups", "2020-11-01"), + new Tuple("Network", "FlowLogs", "2020-11-01"), + new Tuple("Network", "GetActiveSessions", "2020-11-01"), + new Tuple("Network", "GetBastionShareableLink", "2020-11-01"), + new Tuple("Network", "HubRouteTables", "2020-11-01"), + new Tuple("Network", "HubVirtualNetworkConnections", "2020-11-01"), + new Tuple("Network", "InboundNatRules", "2020-11-01"), + new Tuple("Network", "InboundSecurityRule", "2020-11-01"), + new Tuple("Network", "IpAllocations", "2020-11-01"), + new Tuple("Network", "IpGroups", "2020-11-01"), + new Tuple("Network", "LoadBalancerBackendAddressPools", "2020-11-01"), + new Tuple("Network", "LoadBalancerFrontendIPConfigurations", "2020-11-01"), + new Tuple("Network", "LoadBalancerLoadBalancingRules", "2020-11-01"), + new Tuple("Network", "LoadBalancerNetworkInterfaces", "2020-11-01"), + new Tuple("Network", "LoadBalancerOutboundRules", "2020-11-01"), + new Tuple("Network", "LoadBalancerProbes", "2020-11-01"), + new Tuple("Network", "LoadBalancers", "2020-11-01"), + new Tuple("Network", "LocalNetworkGateways", "2020-11-01"), + new Tuple("Network", "NatGateways", "2020-11-01"), + new Tuple("Network", "NatRules", "2020-11-01"), + new Tuple("Network", "NetworkGroups", "2021-02-01-preview"), + new Tuple("Network", "NetworkInterfaceIPConfigurations", "2020-11-01"), + new Tuple("Network", "NetworkInterfaceLoadBalancers", "2020-11-01"), + new Tuple("Network", "NetworkInterfaceTapConfigurations", "2020-11-01"), + new Tuple("Network", "NetworkInterfaces", "2020-11-01"), + new Tuple("Network", "NetworkManagerCommits", "2021-02-01-preview"), + new Tuple("Network", "NetworkManagerDeploymentStatus", "2021-02-01-preview"), + new Tuple("Network", "NetworkManagerEffectiveSecurityAdminRules", "2021-02-01-preview"), + new Tuple("Network", "NetworkManagers", "2021-02-01-preview"), + new Tuple("Network", "NetworkProfiles", "2020-11-01"), + new Tuple("Network", "NetworkSecurityGroups", "2020-11-01"), + new Tuple("Network", "NetworkSecurityPerimeters", "2021-02-01-preview"), + new Tuple("Network", "NetworkVirtualAppliances", "2020-11-01"), + new Tuple("Network", "NetworkWatchers", "2020-11-01"), + new Tuple("Network", "Operations", "2020-11-01"), + new Tuple("Network", "P2SVpnGateways", "2020-11-01"), + new Tuple("Network", "P2sVpnGateways", "2020-11-01"), + new Tuple("Network", "PacketCaptures", "2020-11-01"), + new Tuple("Network", "PeerExpressRouteCircuitConnections", "2020-11-01"), + new Tuple("Network", "PerimeterAssociableResourceTypes", "2021-02-01-preview"), + new Tuple("Network", "PrivateDnsZoneGroups", "2020-11-01"), + new Tuple("Network", "PrivateEndpoints", "2020-11-01"), + new Tuple("Network", "PrivateLinkServices", "2020-11-01"), + new Tuple("Network", "PublicIPAddresses", "2020-11-01"), + new Tuple("Network", "PublicIPPrefixes", "2020-11-01"), + new Tuple("Network", "PutBastionShareableLink", "2020-11-01"), + new Tuple("Network", "ResourceNavigationLinks", "2020-11-01"), + new Tuple("Network", "RouteFilterRules", "2020-11-01"), + new Tuple("Network", "RouteFilters", "2020-11-01"), + new Tuple("Network", "RouteTables", "2020-11-01"), + new Tuple("Network", "Routes", "2020-11-01"), + new Tuple("Network", "SecurityAdminConfigurations", "2021-02-01-preview"), + new Tuple("Network", "SecurityPartnerProviders", "2020-11-01"), + new Tuple("Network", "SecurityRules", "2020-11-01"), + new Tuple("Network", "SecurityUserConfigurations", "2021-02-01-preview"), + new Tuple("Network", "ServiceAssociationLinks", "2020-11-01"), + new Tuple("Network", "ServiceEndpointPolicies", "2020-11-01"), + new Tuple("Network", "ServiceEndpointPolicyDefinitions", "2020-11-01"), + new Tuple("Network", "ServiceTags", "2020-11-01"), + new Tuple("Network", "Subnets", "2020-11-01"), + new Tuple("Network", "SupportedSecurityProviders", "2020-11-01"), + new Tuple("Network", "Usages", "2020-11-01"), + new Tuple("Network", "UserRuleCollections", "2021-02-01-preview"), + new Tuple("Network", "UserRules", "2021-02-01-preview"), + new Tuple("Network", "VirtualApplianceSites", "2020-11-01"), + new Tuple("Network", "VirtualApplianceSkus", "2020-11-01"), + new Tuple("Network", "VirtualHubBgpConnection", "2020-11-01"), + new Tuple("Network", "VirtualHubBgpConnections", "2020-11-01"), + new Tuple("Network", "VirtualHubIpConfiguration", "2020-11-01"), + new Tuple("Network", "VirtualHubRouteTableV2s", "2020-11-01"), + new Tuple("Network", "VirtualHubs", "2020-11-01"), + new Tuple("Network", "VirtualNetworkGatewayConnections", "2020-11-01"), + new Tuple("Network", "VirtualNetworkGateways", "2020-11-01"), + new Tuple("Network", "VirtualNetworkPeerings", "2020-11-01"), + new Tuple("Network", "VirtualNetworkTaps", "2020-11-01"), + new Tuple("Network", "VirtualNetworks", "2020-11-01"), + new Tuple("Network", "VirtualRouterPeerings", "2020-11-01"), + new Tuple("Network", "VirtualRouters", "2020-11-01"), + new Tuple("Network", "VirtualWans", "2020-11-01"), + new Tuple("Network", "VpnConnections", "2020-11-01"), + new Tuple("Network", "VpnGateways", "2020-11-01"), + new Tuple("Network", "VpnLinkConnections", "2020-11-01"), + new Tuple("Network", "VpnServerConfigurations", "2020-11-01"), + new Tuple("Network", "VpnServerConfigurationsAssociatedWithVirtualWan", "2020-11-01"), + new Tuple("Network", "VpnSiteLinkConnections", "2020-11-01"), + new Tuple("Network", "VpnSiteLinks", "2020-11-01"), + new Tuple("Network", "VpnSites", "2020-11-01"), + new Tuple("Network", "VpnSitesConfiguration", "2020-11-01"), + new Tuple("Network", "WebApplicationFirewallPolicies", "2020-11-01"), + new Tuple("Network", "WebCategories", "2020-11-01"), + new Tuple("Network", "generatevirtualwanvpnserverconfigurationvpnprofile", "2020-11-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/network/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\Projects\\Generator\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "f2d2a985f02c35d130bbc8b38823b1c14ae8fb4a"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperations.cs new file mode 100644 index 000000000000..cc85eb728418 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperations.cs @@ -0,0 +1,1071 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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 + { + /// + /// Initializes a new instance of the SecurityAdminConfigurationsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Lists all the network manager security admin configurations in a network + /// manager, in a paginated format. + /// + /// + /// 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new 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); + } + // Construct URL + var _baseUrl = 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new 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('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Retrieves a network manager security admin configuration. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new 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); + } + // Construct URL + var _baseUrl = 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("{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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + 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. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(SecurityConfiguration securityAdminConfiguration, string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (securityAdminConfiguration == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "securityAdminConfiguration"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("securityAdminConfiguration", securityAdminConfiguration); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = 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("{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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _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); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a network manager security admin configuration. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new 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, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = 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("{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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _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); + } + return _result; + } + + /// + /// 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperationsExtensions.cs new file mode 100644 index 000000000000..9e6c84bb6c31 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperationsExtensions.cs @@ -0,0 +1,264 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// 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; + } + } + + /// + /// 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 SecurityConfiguration Get(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName) + { + return 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)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// 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 SecurityConfiguration CreateOrUpdate(this ISecurityAdminConfigurationsOperations operations, SecurityConfiguration securityAdminConfiguration, string resourceGroupName, string networkManagerName, string configurationName) + { + return operations.CreateOrUpdateAsync(securityAdminConfiguration, resourceGroupName, networkManagerName, configurationName).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, SecurityConfiguration securityAdminConfiguration, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(securityAdminConfiguration, resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)) + { + 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. + /// + public static void Delete(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName) + { + operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName).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. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// 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/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityPartnerProvidersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityPartnerProvidersOperations.cs index a39cbf2e6dbd..e9e4bf35a3c0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityPartnerProvidersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityPartnerProvidersOperations.cs @@ -116,7 +116,7 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -343,7 +343,7 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -715,7 +715,7 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -902,7 +902,7 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1086,7 +1086,7 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityRulesOperations.cs index 37df3ef25cb9..4b344ef09d82 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityRulesOperations.cs @@ -126,7 +126,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +549,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -746,7 +746,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityUserConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityUserConfigurationsOperations.cs new file mode 100644 index 000000000000..e472a16237a8 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityUserConfigurationsOperations.cs @@ -0,0 +1,1071 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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; + + /// + /// SecurityUserConfigurationsOperations operations. + /// + internal partial class SecurityUserConfigurationsOperations : IServiceOperations, ISecurityUserConfigurationsOperations + { + /// + /// Initializes a new instance of the SecurityUserConfigurationsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SecurityUserConfigurationsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Lists all the network manager security user configurations in a network + /// manager, in a paginated format. + /// + /// + /// 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new 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); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + List _queryParameters = new 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('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Retrieves a network manager security user configuration. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new 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); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a network manager security user configuration. + /// + /// + /// The security user 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(SecurityConfiguration securityUserConfiguration, string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (securityUserConfiguration == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "securityUserConfiguration"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("securityUserConfiguration", securityUserConfiguration); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(securityUserConfiguration != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(securityUserConfiguration, Client.SerializationSettings); + _httpRequest.Content = new 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) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a network manager security user configuration. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the network manager. + /// + /// + /// The name of the network manager security Configuration. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new 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, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _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); + } + return _result; + } + + /// + /// Lists all the network manager security user configurations in a network + /// manager, in a paginated format. + /// + /// + /// The NextLink from the previous successful call to List 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityUserConfigurationsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityUserConfigurationsOperationsExtensions.cs new file mode 100644 index 000000000000..4f007201f322 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityUserConfigurationsOperationsExtensions.cs @@ -0,0 +1,264 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SecurityUserConfigurationsOperations. + /// + public static partial class SecurityUserConfigurationsOperationsExtensions + { + /// + /// Lists all the network manager security user 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 ISecurityUserConfigurationsOperations 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 user 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 ISecurityUserConfigurationsOperations 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; + } + } + + /// + /// Retrieves a network manager security user 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 SecurityConfiguration Get(this ISecurityUserConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName) + { + return operations.GetAsync(resourceGroupName, networkManagerName, configurationName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves a network manager security user 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 ISecurityUserConfigurationsOperations 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; + } + } + + /// + /// Creates or updates a network manager security user configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The security user 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 SecurityConfiguration CreateOrUpdate(this ISecurityUserConfigurationsOperations operations, SecurityConfiguration securityUserConfiguration, string resourceGroupName, string networkManagerName, string configurationName) + { + return operations.CreateOrUpdateAsync(securityUserConfiguration, resourceGroupName, networkManagerName, configurationName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a network manager security user configuration. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The security user 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 ISecurityUserConfigurationsOperations operations, SecurityConfiguration securityUserConfiguration, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(securityUserConfiguration, resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a network manager security user 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 void Delete(this ISecurityUserConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName) + { + operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a network manager security user 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 DeleteAsync(this ISecurityUserConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all the network manager security user 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 ISecurityUserConfigurationsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the network manager security user 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 ISecurityUserConfigurationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceAssociationLinksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceAssociationLinksOperations.cs index 69bd83ea764a..cd9fc3d9e5db 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceAssociationLinksOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceAssociationLinksOperations.cs @@ -101,7 +101,7 @@ internal ServiceAssociationLinksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPoliciesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPoliciesOperations.cs index 69589e9f521a..3376b4e0c6e8 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPoliciesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPoliciesOperations.cs @@ -119,7 +119,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -538,7 +538,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -721,7 +721,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -910,7 +910,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1094,7 +1094,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPolicyDefinitionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPolicyDefinitionsOperations.cs index d8e2fd2662a2..21e585af4454 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPolicyDefinitionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPolicyDefinitionsOperations.cs @@ -127,7 +127,7 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -353,7 +353,7 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -551,7 +551,7 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -745,7 +745,7 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagsOperations.cs index ab8eeaed251e..fae13a4882af 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagsOperations.cs @@ -90,7 +90,7 @@ internal ServiceTagsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SubnetsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SubnetsOperations.cs index e857737f5406..3253eb516493 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SubnetsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SubnetsOperations.cs @@ -129,7 +129,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -414,7 +414,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -612,7 +612,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -804,7 +804,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1036,7 +1036,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1232,7 +1232,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UsagesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UsagesOperations.cs index cb8310631c3f..fd93aca6f982 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UsagesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UsagesOperations.cs @@ -94,7 +94,7 @@ internal UsagesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRuleCollectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRuleCollectionsOperations.cs new file mode 100644 index 000000000000..8fbb4e4c35fd --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRuleCollectionsOperations.cs @@ -0,0 +1,1107 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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; + + /// + /// UserRuleCollectionsOperations operations. + /// + internal partial class UserRuleCollectionsOperations : IServiceOperations, IUserRuleCollectionsOperations + { + /// + /// Initializes a new instance of the UserRuleCollectionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal UserRuleCollectionsOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Lists all the user rule collections in a security configuration, in a + /// paginated format. + /// + /// + /// 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new 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); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (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('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a network manager security user configuration rule collection. + /// + /// + /// 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new 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); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a user rule collection. + /// + /// + /// The User 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(RuleCollection userRuleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (userRuleCollection == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "userRuleCollection"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("userRuleCollection", userRuleCollection); + 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, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(userRuleCollection != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(userRuleCollection, Client.SerializationSettings); + _httpRequest.Content = new 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) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a user rule collection. + /// + /// + /// 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. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new 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, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _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); + } + return _result; + } + + /// + /// Lists all the user rule collections in a security configuration, in a + /// paginated format. + /// + /// + /// The NextLink from the previous successful call to List 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRuleCollectionsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRuleCollectionsOperationsExtensions.cs new file mode 100644 index 000000000000..b0a92257d36d --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRuleCollectionsOperationsExtensions.cs @@ -0,0 +1,288 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for UserRuleCollectionsOperations. + /// + public static partial class UserRuleCollectionsOperationsExtensions + { + /// + /// Lists all the user rule collections in a security 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 IUserRuleCollectionsOperations 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 user rule collections in a security 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 IUserRuleCollectionsOperations 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; + } + } + + /// + /// Gets a network manager security user 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 RuleCollection Get(this IUserRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName) + { + return operations.GetAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName).GetAwaiter().GetResult(); + } + + /// + /// Gets a network manager security user 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 IUserRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a user rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The User 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 RuleCollection CreateOrUpdate(this IUserRuleCollectionsOperations operations, RuleCollection userRuleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName) + { + return operations.CreateOrUpdateAsync(userRuleCollection, resourceGroupName, networkManagerName, configurationName, ruleCollectionName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a user rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The User 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 IUserRuleCollectionsOperations operations, RuleCollection userRuleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(userRuleCollection, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a user 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 void Delete(this IUserRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName) + { + operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a user 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 DeleteAsync(this IUserRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all the user rule collections in a security 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 IUserRuleCollectionsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the user rule collections in a security 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 IUserRuleCollectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRulesOperations.cs new file mode 100644 index 000000000000..049c7d53b77d --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRulesOperations.cs @@ -0,0 +1,1141 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + 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; + + /// + /// UserRulesOperations operations. + /// + internal partial class UserRulesOperations : IServiceOperations, IUserRulesOperations + { + /// + /// Initializes a new instance of the UserRulesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal UserRulesOperations(NetworkManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the NetworkManagementClient + /// + public NetworkManagementClient Client { get; private set; } + + /// + /// Lists all user rules in a rule collection. + /// + /// + /// 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + if (top > 20) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + } + if (top < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("ruleCollectionName", ruleCollectionName); + tracingParameters.Add("top", top); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (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('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a user rule. + /// + /// + /// 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + if (ruleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new 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); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a user rule. + /// + /// + /// The user 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. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(BaseUserRule userRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (userRule == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "userRule"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + if (ruleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("userRule", userRule); + 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, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(userRule != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(userRule, Client.SerializationSettings); + _httpRequest.Content = new 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) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes a user rule. + /// + /// + /// 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. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (networkManagerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + } + if (configurationName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + } + if (ruleCollectionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); + } + if (ruleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); + } + string apiVersion = "2021-02-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new 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, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _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); + } + return _result; + } + + /// + /// Lists all user rules in a rule collection. + /// + /// + /// The NextLink from the previous successful call to List 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRulesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRulesOperationsExtensions.cs new file mode 100644 index 000000000000..c062db8a3a89 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRulesOperationsExtensions.cs @@ -0,0 +1,308 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for UserRulesOperations. + /// + public static partial class UserRulesOperationsExtensions + { + /// + /// Lists all user rules in a 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. + /// + /// + /// 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 IUserRulesOperations 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(); + } + + /// + /// Lists all user rules in a 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. + /// + /// + /// 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 IUserRulesOperations 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; + } + } + + /// + /// Gets a user 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 BaseUserRule Get(this IUserRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName) + { + return operations.GetAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName).GetAwaiter().GetResult(); + } + + /// + /// Gets a user 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 IUserRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a user rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The user 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 BaseUserRule CreateOrUpdate(this IUserRulesOperations operations, BaseUserRule userRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName) + { + return operations.CreateOrUpdateAsync(userRule, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a user rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The user 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 IUserRulesOperations operations, BaseUserRule userRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(userRule, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a user 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 void Delete(this IUserRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName) + { + operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a user 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 DeleteAsync(this IUserRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all user rules in a rule collection. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IUserRulesOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all user rules in a rule collection. + /// + /// + /// 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 IUserRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSitesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSitesOperations.cs index e7d7240f5434..f70daf085166 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSitesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSitesOperations.cs @@ -126,7 +126,7 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -352,7 +352,7 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -550,7 +550,7 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -743,7 +743,7 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSkusOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSkusOperations.cs index ec79a1ee1f85..449fa5d2cb9d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSkusOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSkusOperations.cs @@ -80,7 +80,7 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -263,7 +263,7 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "skuName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionOperations.cs index e2b80f1d7aa4..9c339e4c9903 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionOperations.cs @@ -101,7 +101,7 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -370,7 +370,7 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) { parameters.Validate(); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -595,7 +595,7 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionsOperations.cs index 4271ed1ff54e..a56174d4dcfa 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionsOperations.cs @@ -94,7 +94,7 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -346,7 +346,7 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -550,7 +550,7 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubIpConfigurationOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubIpConfigurationOperations.cs index bf751021572f..df80073e3142 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubIpConfigurationOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubIpConfigurationOperations.cs @@ -101,7 +101,7 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "ipConfigName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,7 +560,11 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-02-01"; + if (parameters != null) + { + parameters.Validate(); + } + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -785,7 +789,7 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "ipConfigName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubRouteTableV2sOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubRouteTableV2sOperations.cs index 0de362963f2c..354cd1ec42c8 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubRouteTableV2sOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubRouteTableV2sOperations.cs @@ -101,7 +101,7 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -346,7 +346,7 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -555,7 +555,7 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubRouteTableV2Parameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -775,7 +775,7 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubsOperations.cs index e007237ac2dc..0caf9fd7fd62 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubsOperations.cs @@ -94,7 +94,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -321,7 +321,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -715,7 +715,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -943,7 +943,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { virtualHubParameters.Validate(); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1159,7 +1159,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1336,7 +1336,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayConnectionsOperations.cs index 5ce0797b1fac..1604eab56618 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayConnectionsOperations.cs @@ -121,7 +121,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -393,7 +393,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -581,7 +581,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -914,7 +914,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1130,7 +1130,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1313,7 +1313,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1529,7 +1529,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1763,7 +1763,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1969,7 +1969,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2174,7 +2174,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2371,7 +2371,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2557,7 +2557,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperationsExtensions.cs deleted file mode 100644 index ee814ec18468..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperationsExtensions.cs +++ /dev/null @@ -1,339 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// 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(); - } - - /// - /// 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)) - { - (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 IPage ListByVirtualNetworkGateway(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName) - { - return operations.ListByVirtualNetworkGatewayAsync(resourceGroupName, virtualNetworkGatewayName).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; - } - } - - /// - /// 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) - { - return 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)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(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 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 Task BeginDeleteAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, CancellationToken cancellationToken = default(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 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/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewaysOperations.cs index f47cb2856962..40fb68495c63 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewaysOperations.cs @@ -120,7 +120,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -354,7 +354,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -546,7 +546,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -893,7 +893,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1196,7 +1196,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1512,7 +1512,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1728,7 +1728,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1911,7 +1911,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2117,7 +2117,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2314,7 +2314,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2499,7 +2499,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2709,7 +2709,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2912,7 +2912,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3109,7 +3109,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3309,7 +3309,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3511,7 +3511,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3724,7 +3724,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3927,7 +3927,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4126,7 +4126,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4331,7 +4331,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4528,7 +4528,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4727,7 +4727,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "request"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperations.cs index 0657a5726962..0ccd8566d238 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperations.cs @@ -126,7 +126,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -294,21 +294,16 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// 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. /// /// /// 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 Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -356,7 +351,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -554,7 +549,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -704,11 +699,6 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// 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. /// @@ -730,7 +720,7 @@ 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 Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -756,7 +746,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -768,7 +758,6 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("virtualNetworkPeeringName", virtualNetworkPeeringName); tracingParameters.Add("virtualNetworkPeeringParameters", virtualNetworkPeeringParameters); - tracingParameters.Add("syncRemoteAddressSpace", syncRemoteAddressSpace); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); @@ -781,10 +770,6 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkPeeringName}", System.Uri.EscapeDataString(virtualNetworkPeeringName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (syncRemoteAddressSpace != null) - { - _queryParameters.Add(string.Format("syncRemoteAddressSpace={0}", System.Uri.EscapeDataString(syncRemoteAddressSpace))); - } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperationsExtensions.cs index f6a980126589..d4c7431621d0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperationsExtensions.cs @@ -129,14 +129,9 @@ public static VirtualNetworkPeering Get(this IVirtualNetworkPeeringsOperations o /// 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)) + public static VirtualNetworkPeering CreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters) { - return operations.CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).GetAwaiter().GetResult(); } /// @@ -158,17 +153,12 @@ public static VirtualNetworkPeering Get(this IVirtualNetworkPeeringsOperations o /// 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)) + public static async Task CreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -276,14 +266,9 @@ public static void BeginDelete(this IVirtualNetworkPeeringsOperations operations /// 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)) + public static VirtualNetworkPeering BeginCreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace).GetAwaiter().GetResult(); + return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).GetAwaiter().GetResult(); } /// @@ -305,17 +290,12 @@ public static void BeginDelete(this IVirtualNetworkPeeringsOperations operations /// 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)) + public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkTapsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkTapsOperations.cs index 597fbe0ff08c..44def54e4fbe 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkTapsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkTapsOperations.cs @@ -116,7 +116,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -342,7 +342,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -529,7 +529,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -712,7 +712,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -901,7 +901,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1080,11 +1080,15 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworksOperations.cs index 5c62b84b0096..8198937acc58 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworksOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworksOperations.cs @@ -119,7 +119,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -720,7 +720,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -919,7 +919,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1118,7 +1118,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1309,7 +1309,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1496,7 +1496,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRouterPeeringsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRouterPeeringsOperations.cs index 54e6b69979aa..e0b0cb92bc27 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRouterPeeringsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRouterPeeringsOperations.cs @@ -126,7 +126,7 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -346,7 +346,7 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -539,7 +539,7 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -731,7 +731,7 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRoutersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRoutersOperations.cs index 8c83fc5c0eef..091c4bd58907 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRoutersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRoutersOperations.cs @@ -119,7 +119,7 @@ internal VirtualRoutersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -331,7 +331,7 @@ internal VirtualRoutersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -504,7 +504,7 @@ internal VirtualRoutersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -686,7 +686,7 @@ internal VirtualRoutersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -868,7 +868,7 @@ internal VirtualRoutersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperations.cs index bf2e24e694f4..477f05588dbd 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperations.cs @@ -94,7 +94,7 @@ internal VirtualWansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -321,7 +321,7 @@ internal VirtualWansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "wANParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal VirtualWansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -715,7 +715,7 @@ internal VirtualWansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -913,7 +913,7 @@ internal VirtualWansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "wANParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1129,7 +1129,7 @@ internal VirtualWansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnConnectionsOperations.cs index 66d5205ffd41..aa8debf87029 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnConnectionsOperations.cs @@ -101,7 +101,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -409,7 +409,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -618,7 +618,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnConnectionParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -843,7 +843,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1032,7 +1032,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1246,7 +1246,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnGatewaysOperations.cs index c3c39af40b43..aac3bd284911 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnGatewaysOperations.cs @@ -94,7 +94,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -428,7 +428,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -606,7 +606,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -808,7 +808,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { vpnGatewayParameters.Validate(); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1034,7 +1034,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnGatewayParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1232,7 +1232,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1408,7 +1408,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1606,7 +1606,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1811,7 +1811,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnLinkConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnLinkConnectionsOperations.cs index f64eadd2408b..c10942629591 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnLinkConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnLinkConnectionsOperations.cs @@ -159,7 +159,7 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -366,7 +366,7 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "linkConnectionName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -556,7 +556,7 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "linkConnectionName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsAssociatedWithVirtualWanOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsAssociatedWithVirtualWanOperations.cs index 667e9949f2b1..c4afc6646191 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsAssociatedWithVirtualWanOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsAssociatedWithVirtualWanOperations.cs @@ -120,7 +120,7 @@ internal VpnServerConfigurationsAssociatedWithVirtualWanOperations(NetworkManage { throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsOperations.cs index 20bb3c551cb5..d99abe8ef4e3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsOperations.cs @@ -94,7 +94,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -321,7 +321,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -715,7 +715,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -913,7 +913,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1129,7 +1129,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinkConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinkConnectionsOperations.cs index cd6fcd2a6fc1..8fb5dcdd2956 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinkConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinkConnectionsOperations.cs @@ -108,7 +108,7 @@ internal VpnSiteLinkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "linkConnectionName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinksOperations.cs index 5406d91b1a3c..29b6f886a6b3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinksOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinksOperations.cs @@ -101,7 +101,7 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteLinkName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -297,7 +297,7 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesConfigurationOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesConfigurationOperations.cs index ea299f7b5105..7123e2f456ea 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesConfigurationOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesConfigurationOperations.cs @@ -131,7 +131,7 @@ internal VpnSitesConfigurationOperations(NetworkManagementClient client) { request.Validate(); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesOperations.cs index 9f606dfb62d2..a2e680760bc0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesOperations.cs @@ -94,7 +94,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -321,7 +321,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteParameters"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -715,7 +715,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -917,7 +917,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { vpnSiteParameters.Validate(); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1133,7 +1133,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteName"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebApplicationFirewallPoliciesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebApplicationFirewallPoliciesOperations.cs index 9c640e0fff45..83783fcc8dfd 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebApplicationFirewallPoliciesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebApplicationFirewallPoliciesOperations.cs @@ -87,7 +87,7 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -265,7 +265,7 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -462,7 +462,7 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -675,7 +675,7 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client { parameters.Validate(); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -920,7 +920,7 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebCategoriesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebCategoriesOperations.cs index 9729187dde5b..f9692b3b3a8a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebCategoriesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebCategoriesOperations.cs @@ -90,7 +90,7 @@ internal WebCategoriesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -273,7 +273,7 @@ internal WebCategoriesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01"; + string apiVersion = "2020-11-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Microsoft.Azure.Management.Network.csproj b/sdk/network/Microsoft.Azure.Management.Network/src/Microsoft.Azure.Management.Network.csproj index 13c647215f94..2cb09a22bfed 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Microsoft.Azure.Management.Network.csproj +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Microsoft.Azure.Management.Network.csproj @@ -10,7 +10,7 @@ Development of this library has shifted focus to the Azure Unified SDK. The future development will be focused on "Azure.ResourceManager.Network" (https://www.nuget.org/packages/Azure.ResourceManager.Network/). Please see the package changelog for more information. Microsoft.Azure.Management.Network - 20.5.0 + 20.6.0 Microsoft Azure Network management;Network;Network management; Date: Sun, 29 Aug 2021 17:55:29 -0700 Subject: [PATCH 2/3] Generated based on correct swagger --- .../mgmtmetadata/network_resource-manager.txt | 10 +- ...iveConnectivityConfigurationsOperations.cs | 262 --- ...ivityConfigurationsOperationsExtensions.cs | 71 - .../ActiveSecurityAdminRulesOperations.cs | 262 --- ...eSecurityAdminRulesOperationsExtensions.cs | 71 - .../ActiveSecurityUserRulesOperations.cs | 262 --- ...veSecurityUserRulesOperationsExtensions.cs | 71 - .../AdminRuleCollectionsOperations.cs | 1107 ----------- ...dminRuleCollectionsOperationsExtensions.cs | 288 --- .../src/Generated/AdminRulesOperations.cs | 1141 ------------ .../AdminRulesOperationsExtensions.cs | 308 ---- ...wayPrivateEndpointConnectionsOperations.cs | 12 +- ...onGatewayPrivateLinkResourcesOperations.cs | 2 +- .../ApplicationGatewaysOperations.cs | 34 +- .../ApplicationSecurityGroupsOperations.cs | 12 +- .../AvailableDelegationsOperations.cs | 2 +- .../AvailableEndpointServicesOperations.cs | 2 +- ...AvailablePrivateEndpointTypesOperations.cs | 4 +- ...lableResourceGroupDelegationsOperations.cs | 2 +- .../AvailableServiceAliasesOperations.cs | 4 +- .../AzureFirewallFqdnTagsOperations.cs | 2 +- .../src/Generated/AzureFirewallsOperations.cs | 12 +- .../src/Generated/BastionHostsOperations.cs | 247 ++- .../BastionHostsOperationsExtensions.cs | 92 + .../BgpServiceCommunitiesOperations.cs | 2 +- .../Generated/ConnectionMonitorsOperations.cs | 16 +- ...ivityConfigurationsOperationsExtensions.cs | 270 --- .../Generated/CustomIPPrefixesOperations.cs | 16 +- .../Generated/DdosCustomPoliciesOperations.cs | 8 +- .../DdosProtectionPlansOperations.cs | 12 +- .../DefaultSecurityRulesOperations.cs | 4 +- .../Generated/DscpConfigurationOperations.cs | 10 +- ...iveConnectivityConfigurationsOperations.cs | 263 --- ...ivityConfigurationsOperationsExtensions.cs | 73 - ...tiveVirtualNetworksOperationsExtensions.cs | 143 -- ...essRouteCircuitAuthorizationsOperations.cs | 8 +- ...xpressRouteCircuitConnectionsOperations.cs | 8 +- .../ExpressRouteCircuitPeeringsOperations.cs | 8 +- .../ExpressRouteCircuitsOperations.cs | 22 +- .../ExpressRouteConnectionsOperations.cs | 8 +- ...sRouteCrossConnectionPeeringsOperations.cs | 8 +- .../ExpressRouteCrossConnectionsOperations.cs | 16 +- .../ExpressRouteGatewaysOperations.cs | 12 +- .../Generated/ExpressRouteLinksOperations.cs | 4 +- .../ExpressRoutePortsLocationsOperations.cs | 4 +- .../Generated/ExpressRoutePortsOperations.cs | 14 +- .../ExpressRouteServiceProvidersOperations.cs | 2 +- .../Generated/FirewallPoliciesOperations.cs | 14 +- ...allPolicyRuleCollectionGroupsOperations.cs | 8 +- .../src/Generated/FlowLogsOperations.cs | 10 +- .../src/Generated/HubRouteTablesOperations.cs | 8 +- .../HubVirtualNetworkConnectionsOperations.cs | 8 +- ...iveConnectivityConfigurationsOperations.cs | 55 - .../IActiveSecurityAdminRulesOperations.cs | 55 - .../IActiveSecurityUserRulesOperations.cs | 55 - .../IAdminRuleCollectionsOperations.cs | 186 -- .../src/Generated/IAdminRulesOperations.cs | 196 -- .../src/Generated/IBastionHostsOperations.cs | 56 + .../IConnectivityConfigurationsOperations.cs | 175 -- ...iveConnectivityConfigurationsOperations.cs | 56 - .../IEffectiveVirtualNetworksOperations.cs | 96 - .../src/Generated/ILoadBalancersOperations.cs | 44 + .../src/Generated/INetworkGroupsOperations.cs | 174 -- .../src/Generated/INetworkManagementClient.cs | 105 +- .../INetworkManagerCommitsOperations.cs | 55 - ...etworkManagerDeploymentStatusOperations.cs | 56 - ...erEffectiveSecurityAdminRulesOperations.cs | 56 - .../Generated/INetworkManagersOperations.cs | 235 --- ...imeterAssociableResourceTypesOperations.cs | 50 - .../ISecurityAdminConfigurationsOperations.cs | 170 -- .../ISecurityUserConfigurationsOperations.cs | 170 -- .../IServiceTagInformationOperations.cs | 80 + .../IUserRuleCollectionsOperations.cs | 185 -- .../src/Generated/IUserRulesOperations.cs | 196 -- ...irtualNetworkGatewayNatRulesOperations.cs} | 110 +- .../IVirtualNetworkPeeringsOperations.cs | 14 +- .../Generated/InboundNatRulesOperations.cs | 12 +- .../InboundSecurityRuleOperations.cs | 2 +- .../src/Generated/IpAllocationsOperations.cs | 12 +- .../src/Generated/IpGroupsOperations.cs | 12 +- ...adBalancerBackendAddressPoolsOperations.cs | 8 +- ...ancerFrontendIPConfigurationsOperations.cs | 4 +- ...oadBalancerLoadBalancingRulesOperations.cs | 4 +- ...LoadBalancerNetworkInterfacesOperations.cs | 2 +- .../LoadBalancerOutboundRulesOperations.cs | 4 +- .../Generated/LoadBalancerProbesOperations.cs | 4 +- .../src/Generated/LoadBalancersOperations.cs | 216 ++- .../LoadBalancersOperationsExtensions.cs | 74 + .../LocalNetworkGatewaysOperations.cs | 10 +- .../Models/ActiveBaseSecurityAdminRule.cs | 124 -- .../Models/ActiveBaseSecurityUserRule.cs | 122 -- .../Models/ActiveConfigurationParameter.cs | 67 - .../Models/ActiveConnectivityConfiguration.cs | 91 - ...iveConnectivityConfigurationsListResult.cs | 70 - .../Models/ActiveDefaultSecurityAdminRule.cs | 183 -- .../Models/ActiveDefaultSecurityUserRule.cs | 160 -- .../Models/ActiveSecurityAdminRule.cs | 203 --- .../ActiveSecurityAdminRulesListResult.cs | 70 - .../Models/ActiveSecurityUserRule.cs | 166 -- .../ActiveSecurityUserRulesListResult.cs | 70 - .../src/Generated/Models/AddressPrefixItem.cs | 61 - .../src/Generated/Models/AdminRule.cs | 196 -- .../Generated/Models/ApplicationGateway.cs | 30 +- ...pplicationGatewayAutoscaleConfiguration.cs | 7 +- ...icationGatewayBackendHealthHttpSettings.cs | 10 - .../ApplicationGatewayBackendHealthServer.cs | 13 - .../ApplicationGatewayGlobalConfiguration.cs | 63 + ...cationGatewayLoadDistributionAlgorithm.cs} | 9 +- ...pplicationGatewayLoadDistributionPolicy.cs | 114 ++ ...pplicationGatewayLoadDistributionTarget.cs | 117 ++ .../Models/ApplicationGatewayPathRule.cs | 12 +- ...icationGatewayPrivateEndpointConnection.cs | 13 - .../Models/ApplicationGatewayProbe.cs | 15 +- .../ApplicationGatewayRequestRoutingRule.cs | 27 +- ...licationGatewayTrustedClientCertificate.cs | 19 +- .../Models/ApplicationGatewayUrlPathMap.cs | 12 +- ...ewayWebApplicationFirewallConfiguration.cs | 37 +- .../src/Generated/Models/ApplicationRule.cs | 1 + .../AzureFirewallApplicationRuleCollection.cs | 15 +- .../AzureFirewallApplicationRuleProtocol.cs | 15 +- .../Models/AzureFirewallNatRuleCollection.cs | 15 +- .../AzureFirewallNetworkRuleCollection.cs | 15 +- .../AzureReachabilityReportLatencyInfo.cs | 15 +- .../Generated/Models/BackendAddressPool.cs | 11 +- .../src/Generated/Models/BaseAdminRule.cs | 58 - .../src/Generated/Models/BaseUserRule.cs | 58 - .../src/Generated/Models/BastionHost.cs | 99 +- ...istingPeering.cs => BastionHostSkuName.cs} | 8 +- .../src/Generated/Models/BgpConnection.cs | 27 +- .../src/Generated/Models/BgpPeerStatus.cs | 15 +- .../src/Generated/Models/BgpSettings.cs | 15 +- .../Generated/Models/ConfigurationGroup.cs | 111 -- .../src/Generated/Models/ConnectionMonitor.cs | 15 +- .../Models/ConnectionMonitorDestination.cs | 15 +- .../ConnectionMonitorHttpConfiguration.cs | 15 +- .../Models/ConnectionMonitorParameters.cs | 15 +- .../Models/ConnectionMonitorResult.cs | 15 +- .../Models/ConnectionMonitorSource.cs | 15 +- .../ConnectionMonitorTcpConfiguration.cs | 15 +- .../Models/ConnectionStateSnapshot.cs | 75 +- .../Models/ConnectivityConfiguration.cs | 151 -- .../Models/ConnectivityDestination.cs | 15 +- .../Generated/Models/ConnectivityGroupItem.cs | 78 - .../Generated/Models/ConnectivitySource.cs | 15 +- .../src/Generated/Models/CustomIpPrefix.cs | 60 +- .../src/Generated/Models/DefaultAdminRule.cs | 174 -- .../src/Generated/Models/DefaultUserRule.cs | 151 -- .../Generated/Models/DeleteExistingNSGs.cs | 22 - .../{UseHubGateway.cs => DeleteOptions.cs} | 8 +- .../src/Generated/Models/DeploymentStatus.cs | 24 - .../src/Generated/Models/DscpConfiguration.cs | 14 +- .../Models/EffectiveBaseSecurityAdminRule.cs | 108 -- .../EffectiveConnectivityConfiguration.cs | 155 -- .../EffectiveDefaultSecurityAdminRule.cs | 181 -- ...ffectiveNetworkSecurityGroupAssociation.cs | 11 +- .../Models/EffectiveSecurityAdminRule.cs | 201 -- .../Models/EffectiveVirtualNetwork.cs | 69 - .../EffectiveVirtualNetworksListResult.cs | 68 - .../EffectiveVirtualNetworksParameter.cs | 64 - .../Generated/Models/ExplicitProxySettings.cs | 132 ++ .../Models/ExpressRouteCircuitPeering.cs | 15 +- .../ExpressRouteCrossConnectionPeering.cs | 15 +- .../src/Generated/Models/ExtendedLocation.cs | 31 +- .../src/Generated/Models/FirewallPolicy.cs | 32 +- .../FirewallPolicyFilterRuleCollection.cs | 1 + .../Models/FirewallPolicyNatRuleCollection.cs | 1 + .../Generated/Models/FirewallPolicyRule.cs | 1 + .../FirewallPolicyRuleApplicationProtocol.cs | 15 +- .../Models/FirewallPolicyRuleCollection.cs | 16 +- .../FirewallPolicyRuleCollectionGroup.cs | 15 +- .../Models/{Hub.cs => FirewallPolicySQL.cs} | 34 +- .../Models/FrontendIpConfiguration.cs | 24 +- .../GatewayLoadBalancerTunnelInterface.cs | 86 + ...GatewayLoadBalancerTunnelInterfaceType.cs} | 10 +- ...s => GatewayLoadBalancerTunnelProtocol.cs} | 7 +- .../src/Generated/Models/HopLink.cs | 45 +- .../Generated/Models/HubIpConfiguration.cs | 13 - .../src/Generated/Models/IPConfiguration.cs | 13 - .../src/Generated/Models/InboundNatRule.cs | 58 +- .../Generated/Models/InboundSecurityRules.cs | 15 +- .../src/Generated/Models/LoadBalancer.cs | 73 - .../src/Generated/Models/LoadBalancerSku.cs | 4 +- .../Generated/Models/LoadBalancerSkuName.cs | 1 + .../Models/LoadBalancerVipSwapRequest.cs | 55 + ...erVipSwapRequestFrontendIPConfiguration.cs | 66 + .../src/Generated/Models/LoadBalancingRule.cs | 13 +- .../src/Generated/Models/MembershipType.cs | 22 - .../src/Generated/Models/NatRule.cs | 1 + .../src/Generated/Models/NetworkGroup.cs | 118 -- .../NetworkGroupsCreateOrUpdateHeaders.cs | 53 - .../src/Generated/Models/NetworkInterface.cs | 53 +- .../Models/NetworkInterfaceIpConfiguration.cs | 44 +- .../NetworkInterfaceTapConfiguration.cs | 13 - .../src/Generated/Models/NetworkManager.cs | 120 -- .../Generated/Models/NetworkManagerCommit.cs | 79 - .../Models/NetworkManagerDeploymentStatus.cs | 99 - ...etworkManagerDeploymentStatusListResult.cs | 68 - ...NetworkManagerDeploymentStatusParameter.cs | 74 - ...tiveConnectivityConfigurationListResult.cs | 70 - ...erEffectiveSecurityAdminRulesListResult.cs | 70 - ...rkManagerPropertiesNetworkManagerScopes.cs | 63 - .../Models/NetworkManagerSecurityGroupItem.cs | 53 - .../src/Generated/Models/NetworkRule.cs | 1 + .../Models/NetworkSecurityPerimeter.cs | 94 - .../Models/NetworkVirtualAppliance.cs | 25 +- .../src/Generated/Models/PacketCapture.cs | 45 +- .../Models/PacketCaptureParameters.cs | 45 +- .../Generated/Models/PacketCaptureResult.cs | 45 +- .../Models/PerimeterAssociableResource.cs | 84 - .../PerimeterAssociableResourcesListResult.cs | 65 - .../src/Generated/Models/PolicySettings.cs | 18 +- ...Topology.cs => PreferredRoutingGateway.cs} | 9 +- .../src/Generated/Models/PrivateEndpoint.cs | 56 +- .../Models/PrivateEndpointConnection.cs | 13 - .../Models/PrivateEndpointIPConfiguration.cs | 107 ++ .../Generated/Models/PrivateLinkService.cs | 43 - .../src/Generated/Models/ProxyResource.cs | 79 - .../src/Generated/Models/PublicIPPrefix.cs | 13 - .../src/Generated/Models/PublicIpAddress.cs | 38 +- .../src/Generated/Models/QosDefinition.cs | 100 + .../Generated/Models/QueryRequestOptions.cs | 55 - .../src/Generated/Models/RuleCollection.cs | 100 - .../Generated/Models/SecurityConfiguration.cs | 111 -- .../Models/SecurityConfigurationRuleAccess.cs | 23 - .../SecurityConfigurationRuleDirection.cs | 22 - .../SecurityConfigurationRuleProtocol.cs | 26 - .../src/Generated/Models/SecurityType.cs | 22 - .../Generated/Models/ServiceEndpointPolicy.cs | 21 +- .../Models/ServiceEndpointPolicyDefinition.cs | 10 +- .../Generated/Models/ServiceTagInformation.cs | 11 +- .../Models/{GroupMembersItem.cs => Sku.cs} | 24 +- ...{IsGlobal.cs => SyncRemoteAddressSpace.cs} | 7 +- .../src/Generated/Models/SystemData.cs | 103 -- .../src/Generated/Models/UserRule.cs | 159 -- .../src/Generated/Models/VirtualHub.cs | 38 +- .../src/Generated/Models/VirtualNetwork.cs | 16 +- .../Generated/Models/VirtualNetworkGateway.cs | 45 +- .../Models/VirtualNetworkGatewayConnection.cs | 19 +- .../Models/VirtualNetworkGatewayNatRule.cs | 140 ++ .../Generated/Models/VirtualNetworkPeering.cs | 33 +- ...yType.cs => VirtualNetworkPeeringLevel.cs} | 12 +- .../src/Generated/Models/VirtualNetworkTap.cs | 27 - .../src/Generated/Models/VirtualRouter.cs | 15 +- .../Generated/Models/VirtualRouterPeering.cs | 15 +- .../src/Generated/Models/VnetRoute.cs | 11 +- .../src/Generated/Models/VpnGateway.cs | 12 +- .../src/Generated/NatGatewaysOperations.cs | 12 +- .../src/Generated/NatRulesOperations.cs | 8 +- .../src/Generated/NetworkGroupsOperations.cs | 1096 ----------- .../NetworkGroupsOperationsExtensions.cs | 270 --- ...workInterfaceIPConfigurationsOperations.cs | 4 +- ...NetworkInterfaceLoadBalancersOperations.cs | 2 +- ...orkInterfaceTapConfigurationsOperations.cs | 12 +- .../Generated/NetworkInterfacesOperations.cs | 26 +- .../src/Generated/NetworkManagementClient.cs | 152 +- .../NetworkManagerCommitsOperations.cs | 262 --- ...tworkManagerCommitsOperationsExtensions.cs | 71 - ...etworkManagerDeploymentStatusOperations.cs | 262 --- ...gerDeploymentStatusOperationsExtensions.cs | 71 - ...erEffectiveSecurityAdminRulesOperations.cs | 262 --- ...eSecurityAdminRulesOperationsExtensions.cs | 71 - .../Generated/NetworkManagersOperations.cs | 1618 ----------------- .../NetworkManagersOperationsExtensions.cs | 364 ---- .../Generated/NetworkProfilesOperations.cs | 12 +- .../NetworkSecurityGroupsOperations.cs | 12 +- .../NetworkSecurityPerimetersOperations.cs | 1410 -------------- ...kSecurityPerimetersOperationsExtensions.cs | 318 ---- .../NetworkVirtualAppliancesOperations.cs | 12 +- .../Generated/NetworkWatchersOperations.cs | 36 +- .../src/Generated/Operations.cs | 2 +- .../src/Generated/P2sVpnGatewaysOperations.cs | 22 +- .../src/Generated/PacketCapturesOperations.cs | 12 +- ...xpressRouteCircuitConnectionsOperations.cs | 4 +- ...imeterAssociableResourceTypesOperations.cs | 240 --- ...ciableResourceTypesOperationsExtensions.cs | 61 - .../PrivateDnsZoneGroupsOperations.cs | 8 +- .../Generated/PrivateEndpointsOperations.cs | 14 +- .../PrivateLinkServicesOperations.cs | 34 +- .../Generated/PublicIPPrefixesOperations.cs | 16 +- .../Generated/PublicIpAddressesOperations.cs | 22 +- .../ResourceNavigationLinksOperations.cs | 2 +- .../Generated/RouteFilterRulesOperations.cs | 8 +- .../src/Generated/RouteFiltersOperations.cs | 12 +- .../src/Generated/RouteTablesOperations.cs | 12 +- .../src/Generated/RoutesOperations.cs | 8 +- .../SdkInfo_NetworkManagementClient.cs | 255 ++- .../SecurityAdminConfigurationsOperations.cs | 1071 ----------- ...AdminConfigurationsOperationsExtensions.cs | 264 --- .../SecurityPartnerProvidersOperations.cs | 12 +- .../src/Generated/SecurityRulesOperations.cs | 8 +- .../SecurityUserConfigurationsOperations.cs | 1071 ----------- ...yUserConfigurationsOperationsExtensions.cs | 264 --- .../ServiceAssociationLinksOperations.cs | 2 +- .../ServiceEndpointPoliciesOperations.cs | 12 +- ...viceEndpointPolicyDefinitionsOperations.cs | 8 +- ....cs => ServiceTagInformationOperations.cs} | 168 +- ...rviceTagInformationOperationsExtensions.cs | 111 ++ .../src/Generated/ServiceTagsOperations.cs | 2 +- .../src/Generated/SubnetsOperations.cs | 12 +- .../src/Generated/UsagesOperations.cs | 2 +- .../UserRuleCollectionsOperations.cs | 1107 ----------- ...UserRuleCollectionsOperationsExtensions.cs | 288 --- .../src/Generated/UserRulesOperations.cs | 1141 ------------ .../UserRulesOperationsExtensions.cs | 308 ---- .../VirtualApplianceSitesOperations.cs | 8 +- .../VirtualApplianceSkusOperations.cs | 4 +- .../VirtualHubBgpConnectionOperations.cs | 6 +- .../VirtualHubBgpConnectionsOperations.cs | 6 +- .../VirtualHubIpConfigurationOperations.cs | 12 +- .../VirtualHubRouteTableV2sOperations.cs | 8 +- .../src/Generated/VirtualHubsOperations.cs | 14 +- ...tualNetworkGatewayConnectionsOperations.cs | 24 +- ...irtualNetworkGatewayNatRulesOperations.cs} | 374 ++-- ...workGatewayNatRulesOperationsExtensions.cs | 339 ++++ .../VirtualNetworkGatewaysOperations.cs | 44 +- .../VirtualNetworkPeeringsOperations.cs | 29 +- ...tualNetworkPeeringsOperationsExtensions.cs | 36 +- .../Generated/VirtualNetworkTapsOperations.cs | 16 +- .../Generated/VirtualNetworksOperations.cs | 16 +- .../VirtualRouterPeeringsOperations.cs | 8 +- .../src/Generated/VirtualRoutersOperations.cs | 10 +- .../src/Generated/VirtualWANsOperations.cs | 12 +- .../src/Generated/VpnConnectionsOperations.cs | 12 +- .../src/Generated/VpnGatewaysOperations.cs | 18 +- .../Generated/VpnLinkConnectionsOperations.cs | 6 +- ...tionsAssociatedWithVirtualWanOperations.cs | 2 +- .../VpnServerConfigurationsOperations.cs | 12 +- .../VpnSiteLinkConnectionsOperations.cs | 2 +- .../src/Generated/VpnSiteLinksOperations.cs | 4 +- .../VpnSitesConfigurationOperations.cs | 2 +- .../src/Generated/VpnSitesOperations.cs | 12 +- ...ebApplicationFirewallPoliciesOperations.cs | 10 +- .../src/Generated/WebCategoriesOperations.cs | 4 +- 333 files changed, 4365 insertions(+), 25940 deletions(-) delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveConnectivityConfigurationsOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveConnectivityConfigurationsOperationsExtensions.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityAdminRulesOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityAdminRulesOperationsExtensions.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityUserRulesOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityUserRulesOperationsExtensions.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperationsExtensions.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperationsExtensions.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperationsExtensions.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveConnectivityConfigurationsOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveConnectivityConfigurationsOperationsExtensions.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveVirtualNetworksOperationsExtensions.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveConnectivityConfigurationsOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityAdminRulesOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityUserRulesOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRuleCollectionsOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRulesOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IConnectivityConfigurationsOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IEffectiveConnectivityConfigurationsOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IEffectiveVirtualNetworksOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkGroupsOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerCommitsOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerDeploymentStatusOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerEffectiveSecurityAdminRulesOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagersOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPerimeterAssociableResourceTypesOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityAdminConfigurationsOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityUserConfigurationsOperations.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IServiceTagInformationOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IUserRuleCollectionsOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/IUserRulesOperations.cs rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/{INetworkSecurityPerimetersOperations.cs => IVirtualNetworkGatewayNatRulesOperations.cs} (58%) delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityAdminRule.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityUserRule.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConfigurationParameter.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfiguration.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfigurationsListResult.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityAdminRule.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityUserRule.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRule.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRulesListResult.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRule.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRulesListResult.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AddressPrefixItem.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AdminRule.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayGlobalConfiguration.cs rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{AddressPrefixType.cs => ApplicationGatewayLoadDistributionAlgorithm.cs} (59%) create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayLoadDistributionPolicy.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayLoadDistributionTarget.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseAdminRule.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseUserRule.cs rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{DeleteExistingPeering.cs => BastionHostSkuName.cs} (71%) delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationGroup.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityConfiguration.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityGroupItem.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultAdminRule.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultUserRule.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteExistingNSGs.cs rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{UseHubGateway.cs => DeleteOptions.cs} (72%) delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeploymentStatus.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveBaseSecurityAdminRule.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveConnectivityConfiguration.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveDefaultSecurityAdminRule.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveSecurityAdminRule.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetwork.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksListResult.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksParameter.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExplicitProxySettings.cs rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{Hub.cs => FirewallPolicySQL.cs} (51%) create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelInterface.cs rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{ConfigurationType.cs => GatewayLoadBalancerTunnelInterfaceType.cs} (62%) rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{GroupConnectivity.cs => GatewayLoadBalancerTunnelProtocol.cs} (70%) create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequest.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequestFrontendIPConfiguration.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MembershipType.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroup.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroupsCreateOrUpdateHeaders.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManager.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerCommit.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatus.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusListResult.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusParameter.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveConnectivityConfigurationListResult.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveSecurityAdminRulesListResult.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerPropertiesNetworkManagerScopes.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerSecurityGroupItem.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkSecurityPerimeter.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PerimeterAssociableResource.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PerimeterAssociableResourcesListResult.cs rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{ConnectivityTopology.cs => PreferredRoutingGateway.cs} (64%) create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpointIPConfiguration.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ProxyResource.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/QosDefinition.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/QueryRequestOptions.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/RuleCollection.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfiguration.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleAccess.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleDirection.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleProtocol.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityType.cs rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{GroupMembersItem.cs => Sku.cs} (60%) rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{IsGlobal.cs => SyncRemoteAddressSpace.cs} (74%) delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SystemData.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UserRule.cs create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayNatRule.cs rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/{CreatedByType.cs => VirtualNetworkPeeringLevel.cs} (55%) delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperationsExtensions.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperationsExtensions.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerDeploymentStatusOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerDeploymentStatusOperationsExtensions.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerEffectiveSecurityAdminRulesOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerEffectiveSecurityAdminRulesOperationsExtensions.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperationsExtensions.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperationsExtensions.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperationsExtensions.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperationsExtensions.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityUserConfigurationsOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityUserConfigurationsOperationsExtensions.cs rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/{EffectiveVirtualNetworksOperations.cs => ServiceTagInformationOperations.cs} (66%) create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagInformationOperationsExtensions.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRuleCollectionsOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRuleCollectionsOperationsExtensions.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRulesOperations.cs delete mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRulesOperationsExtensions.cs rename sdk/network/Microsoft.Azure.Management.Network/src/Generated/{ConnectivityConfigurationsOperations.cs => VirtualNetworkGatewayNatRulesOperations.cs} (81%) create mode 100644 sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperationsExtensions.cs diff --git a/eng/mgmt/mgmtmetadata/network_resource-manager.txt b/eng/mgmt/mgmtmetadata/network_resource-manager.txt index fe2a2d5e80eb..49398feb9f63 100644 --- a/eng/mgmt/mgmtmetadata/network_resource-manager.txt +++ b/eng/mgmt/mgmtmetadata/network_resource-manager.txt @@ -3,13 +3,13 @@ AutoRest installed successfully. Commencing code generation Generating CSharp code Executing AutoRest command -cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/network/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\Projects\Generator\azure-sdk-for-net\sdk -Autorest CSharp Version: 2.3.82 -2021-05-12 00:52:21 UTC +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/main/specification/network/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --use:@microsoft.azure/autorest.csharp@2.3.90 --csharp.output-folder=C:\Projects\generator\azure-sdk-for-net\sdk\network\Microsoft.Azure.Management.Network\src\Generated +Autorest CSharp Version: 2.3.90 +2021-08-30 00:47:36 UTC Azure-rest-api-specs repository information GitHub fork: Azure -Branch: master -Commit: f2d2a985f02c35d130bbc8b38823b1c14ae8fb4a +Branch: main +Commit: cf675c2dcf645a7b79ff0894b2cc9cb43d35a397 AutoRest information Requested version: v2 Bootstrapper version: autorest@2.0.4413 diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveConnectivityConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveConnectivityConfigurationsOperations.cs deleted file mode 100644 index 1697e158f3ee..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveConnectivityConfigurationsOperations.cs +++ /dev/null @@ -1,262 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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; - - /// - /// ActiveConnectivityConfigurationsOperations operations. - /// - internal partial class ActiveConnectivityConfigurationsOperations : IServiceOperations, IActiveConnectivityConfigurationsOperations - { - /// - /// Initializes a new instance of the ActiveConnectivityConfigurationsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal ActiveConnectivityConfigurationsOperations(NetworkManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the NetworkManagementClient - /// - public NetworkManagementClient Client { get; private set; } - - /// - /// Lists active connectivity configurations in a network manager. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkManagerName", networkManagerName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = Client.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(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _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); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveConnectivityConfigurationsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveConnectivityConfigurationsOperationsExtensions.cs deleted file mode 100644 index 91b9e2648a5a..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveConnectivityConfigurationsOperationsExtensions.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for ActiveConnectivityConfigurationsOperations. - /// - public static partial class ActiveConnectivityConfigurationsOperationsExtensions - { - /// - /// 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. - /// - /// - /// Active Configuration Parameter. - /// - public static ActiveConnectivityConfigurationsListResult List(this IActiveConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, object parameters) - { - return operations.ListAsync(resourceGroupName, networkManagerName, parameters).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. - /// - /// - /// Active Configuration Parameter. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IActiveConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, object parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityAdminRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityAdminRulesOperations.cs deleted file mode 100644 index d8fddcce5e64..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityAdminRulesOperations.cs +++ /dev/null @@ -1,262 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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; - - /// - /// ActiveSecurityAdminRulesOperations operations. - /// - internal partial class ActiveSecurityAdminRulesOperations : IServiceOperations, IActiveSecurityAdminRulesOperations - { - /// - /// Initializes a new instance of the ActiveSecurityAdminRulesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal ActiveSecurityAdminRulesOperations(NetworkManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the NetworkManagementClient - /// - public NetworkManagementClient Client { get; private set; } - - /// - /// Lists active security admin rules in a network manager. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkManagerName", networkManagerName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = Client.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(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _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); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityAdminRulesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityAdminRulesOperationsExtensions.cs deleted file mode 100644 index 75cb43b89d03..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityAdminRulesOperationsExtensions.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for ActiveSecurityAdminRulesOperations. - /// - public static partial class ActiveSecurityAdminRulesOperationsExtensions - { - /// - /// 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. - /// - /// - /// Active Configuration Parameter. - /// - public static ActiveSecurityAdminRulesListResult List(this IActiveSecurityAdminRulesOperations operations, string resourceGroupName, string networkManagerName, object parameters) - { - return operations.ListAsync(resourceGroupName, networkManagerName, parameters).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. - /// - /// - /// Active Configuration Parameter. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IActiveSecurityAdminRulesOperations operations, string resourceGroupName, string networkManagerName, object parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityUserRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityUserRulesOperations.cs deleted file mode 100644 index 1c3dbeccddbe..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityUserRulesOperations.cs +++ /dev/null @@ -1,262 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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; - - /// - /// ActiveSecurityUserRulesOperations operations. - /// - internal partial class ActiveSecurityUserRulesOperations : IServiceOperations, IActiveSecurityUserRulesOperations - { - /// - /// Initializes a new instance of the ActiveSecurityUserRulesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal ActiveSecurityUserRulesOperations(NetworkManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the NetworkManagementClient - /// - public NetworkManagementClient Client { get; private set; } - - /// - /// Lists Active Security User Rules in a network manager. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkManagerName", networkManagerName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listActiveSecurityUserRules").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _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); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityUserRulesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityUserRulesOperationsExtensions.cs deleted file mode 100644 index 6c41e9f405aa..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ActiveSecurityUserRulesOperationsExtensions.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for ActiveSecurityUserRulesOperations. - /// - public static partial class ActiveSecurityUserRulesOperationsExtensions - { - /// - /// Lists Active Security User Rules in a network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// Active Configuration Parameter. - /// - public static ActiveSecurityUserRulesListResult List(this IActiveSecurityUserRulesOperations operations, string resourceGroupName, string networkManagerName, object parameters) - { - return operations.ListAsync(resourceGroupName, networkManagerName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Lists Active Security User Rules in a network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// Active Configuration Parameter. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IActiveSecurityUserRulesOperations operations, string resourceGroupName, string networkManagerName, object parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperations.cs deleted file mode 100644 index ff6043978c5e..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperations.cs +++ /dev/null @@ -1,1107 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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 - { - /// - /// Initializes a new instance of the AdminRuleCollectionsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal AdminRuleCollectionsOperations(NetworkManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the NetworkManagementClient - /// - public NetworkManagementClient Client { get; private set; } - - /// - /// Lists all the rule collections in a security admin configuration, in a - /// paginated format. - /// - /// - /// 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - if (top > 20) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); - } - if (top < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new 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); - } - // Construct URL - var _baseUrl = 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("{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 (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('"')))); - } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets a network manager security admin configuration rule collection. - /// - /// - /// 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - if (ruleCollectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new 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); - } - // Construct URL - var _baseUrl = 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("{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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - 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. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager security Configuration. - /// - /// - /// The name of the network manager security Configuration rule collection. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(RuleCollection ruleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (ruleCollection == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollection"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - if (ruleCollectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("ruleCollection", ruleCollection); - 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, "CreateOrUpdate", tracingParameters); - } - // Construct URL - var _baseUrl = 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("{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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _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); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - 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)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes an admin rule collection. - /// - /// - /// 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. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - if (ruleCollectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new 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, "Delete", tracingParameters); - } - // Construct URL - var _baseUrl = 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("{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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - 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)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _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); - } - return _result; - } - - /// - /// Lists all the rule collections in a security admin configuration, in a - /// paginated format. - /// - /// - /// The NextLink from the previous successful call to List 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperationsExtensions.cs deleted file mode 100644 index 01e9248b091b..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRuleCollectionsOperationsExtensions.cs +++ /dev/null @@ -1,288 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// 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; - } - } - - /// - /// 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 RuleCollection Get(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName) - { - return 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)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// 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 RuleCollection CreateOrUpdate(this IAdminRuleCollectionsOperations operations, RuleCollection ruleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName) - { - return operations.CreateOrUpdateAsync(ruleCollection, resourceGroupName, networkManagerName, configurationName, ruleCollectionName).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, RuleCollection ruleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(ruleCollection, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, null, cancellationToken).ConfigureAwait(false)) - { - 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. - /// - public static void Delete(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName) - { - operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName).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. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IAdminRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// 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/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperations.cs deleted file mode 100644 index 22224af60f72..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperations.cs +++ /dev/null @@ -1,1141 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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 - { - /// - /// Initializes a new instance of the AdminRulesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal AdminRulesOperations(NetworkManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the NetworkManagementClient - /// - public NetworkManagementClient Client { get; private set; } - - /// - /// List all network manager security configuration admin rules. - /// - /// - /// 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - if (ruleCollectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); - } - if (top > 20) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); - } - if (top < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkManagerName", networkManagerName); - tracingParameters.Add("configurationName", configurationName); - tracingParameters.Add("ruleCollectionName", ruleCollectionName); - tracingParameters.Add("top", top); - tracingParameters.Add("skipToken", skipToken); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = 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("{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 (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('"')))); - } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets a network manager security configuration admin rule. - /// - /// - /// 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - if (ruleCollectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); - } - if (ruleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new 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); - } - // Construct URL - var _baseUrl = 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("{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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - 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. - /// - /// - /// 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (adminRule == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "adminRule"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - if (ruleCollectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); - } - if (ruleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("adminRule", adminRule); - 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, "CreateOrUpdate", tracingParameters); - } - // Construct URL - var _baseUrl = 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("{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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _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); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - 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)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes an admin rule. - /// - /// - /// 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. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - if (ruleCollectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); - } - if (ruleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new 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, "Delete", tracingParameters); - } - // Construct URL - var _baseUrl = 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("{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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - 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)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _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); - } - return _result; - } - - /// - /// List all network manager security configuration admin rules. - /// - /// - /// The NextLink from the previous successful call to List 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperationsExtensions.cs deleted file mode 100644 index beb48f173673..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AdminRulesOperationsExtensions.cs +++ /dev/null @@ -1,308 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// 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; - } - } - - /// - /// 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 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)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// 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) - { - return operations.CreateOrUpdateAsync(adminRule, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName).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)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(adminRule, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, null, cancellationToken).ConfigureAwait(false)) - { - 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. - /// - public static void Delete(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName) - { - operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName).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. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IAdminRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// 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/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateEndpointConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateEndpointConnectionsOperations.cs index 5eb5c1c1b475..8f5044bbe40c 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateEndpointConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateEndpointConnectionsOperations.cs @@ -155,7 +155,7 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +549,7 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -738,15 +738,11 @@ internal ApplicationGatewayPrivateEndpointConnectionsOperations(NetworkManagemen { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (parameters != null) - { - parameters.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateLinkResourcesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateLinkResourcesOperations.cs index c468b3b247a5..586ff4a7ba8d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateLinkResourcesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewayPrivateLinkResourcesOperations.cs @@ -94,7 +94,7 @@ internal ApplicationGatewayPrivateLinkResourcesOperations(NetworkManagementClien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewaysOperations.cs index 368c80ade2f8..8cd2d587452a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationGatewaysOperations.cs @@ -116,7 +116,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -342,7 +342,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -536,7 +536,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -714,7 +714,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -991,7 +991,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1162,7 +1162,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1333,7 +1333,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1504,7 +1504,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1680,7 +1680,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1856,7 +1856,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2039,7 +2039,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "predefinedPolicyName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2228,7 +2228,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2415,7 +2415,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2631,7 +2631,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2804,7 +2804,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2985,7 +2985,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3196,7 +3196,7 @@ internal ApplicationGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "probeRequest"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationSecurityGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationSecurityGroupsOperations.cs index 2454b8a63c24..5af2cb428750 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationSecurityGroupsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ApplicationSecurityGroupsOperations.cs @@ -116,7 +116,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -343,7 +343,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -530,7 +530,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -713,7 +713,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -902,7 +902,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1086,7 +1086,7 @@ internal ApplicationSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableDelegationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableDelegationsOperations.cs index abdee37b7ca8..d0981f5bb58e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableDelegationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableDelegationsOperations.cs @@ -88,7 +88,7 @@ internal AvailableDelegationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableEndpointServicesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableEndpointServicesOperations.cs index a4c8d494e1dc..3e98585f1779 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableEndpointServicesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableEndpointServicesOperations.cs @@ -87,7 +87,7 @@ internal AvailableEndpointServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailablePrivateEndpointTypesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailablePrivateEndpointTypesOperations.cs index c35ff7911f3a..4be400c04075 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailablePrivateEndpointTypesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailablePrivateEndpointTypesOperations.cs @@ -88,7 +88,7 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -281,7 +281,7 @@ internal AvailablePrivateEndpointTypesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableResourceGroupDelegationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableResourceGroupDelegationsOperations.cs index c219d401c918..3b495c307fa6 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableResourceGroupDelegationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableResourceGroupDelegationsOperations.cs @@ -95,7 +95,7 @@ internal AvailableResourceGroupDelegationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableServiceAliasesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableServiceAliasesOperations.cs index fc50ac4b85ee..7d7385150cd0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableServiceAliasesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AvailableServiceAliasesOperations.cs @@ -87,7 +87,7 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -279,7 +279,7 @@ internal AvailableServiceAliasesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallFqdnTagsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallFqdnTagsOperations.cs index cbcb59123504..06f14d14f46b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallFqdnTagsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallFqdnTagsOperations.cs @@ -80,7 +80,7 @@ internal AzureFirewallFqdnTagsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallsOperations.cs index cc7eaada128f..f00f3a7a00aa 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/AzureFirewallsOperations.cs @@ -116,7 +116,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -353,7 +353,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -531,7 +531,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -718,7 +718,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -912,7 +912,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1138,7 +1138,7 @@ internal AzureFirewallsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BastionHostsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BastionHostsOperations.cs index a78b59c78039..32c92d5abfa3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BastionHostsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BastionHostsOperations.cs @@ -116,7 +116,7 @@ internal BastionHostsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -291,6 +291,31 @@ internal BastionHostsOperations(NetworkManagementClient client) return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// Updates Tags for BastionHost resource + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + /// + /// Parameters supplied to update BastionHost tags. + /// + /// + /// The 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)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, bastionHostName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Lists all Bastion Hosts in a subscription. /// @@ -321,7 +346,7 @@ internal BastionHostsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -504,7 +529,7 @@ internal BastionHostsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -693,7 +718,7 @@ internal BastionHostsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -872,11 +897,15 @@ internal BastionHostsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1051,6 +1080,214 @@ internal BastionHostsOperations(NetworkManagementClient client) return _result; } + /// + /// Updates Tags for BastionHost resource + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + /// + /// Parameters supplied to update BastionHost tags. + /// + /// + /// 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 + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// 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)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (bastionHostName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "bastionHostName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2021-03-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("bastionHostName", bastionHostName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdateTags", tracingParameters); + } + // Construct URL + var _baseUrl = 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{bastionHostName}", System.Uri.EscapeDataString(bastionHostName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _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); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Lists all Bastion Hosts in a subscription. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BastionHostsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BastionHostsOperationsExtensions.cs index 6bdbe3fb8d5c..f801112ca221 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BastionHostsOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BastionHostsOperationsExtensions.cs @@ -144,6 +144,52 @@ public static BastionHost CreateOrUpdate(this IBastionHostsOperations operations } } + /// + /// 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; + } + } + /// /// Lists all Bastion Hosts in a subscription. /// @@ -289,6 +335,52 @@ public static BastionHost BeginCreateOrUpdate(this IBastionHostsOperations opera } } + /// + /// 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) + { + return 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. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateTagsAsync(this IBastionHostsOperations operations, string resourceGroupName, string bastionHostName, TagsObject parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateTagsWithHttpMessagesAsync(resourceGroupName, bastionHostName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Lists all Bastion Hosts in a subscription. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BgpServiceCommunitiesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BgpServiceCommunitiesOperations.cs index b1fe12548e98..9609c91ec2f7 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BgpServiceCommunitiesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/BgpServiceCommunitiesOperations.cs @@ -80,7 +80,7 @@ internal BgpServiceCommunitiesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectionMonitorsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectionMonitorsOperations.cs index 572bde4a13c5..f8c8c6dacb05 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectionMonitorsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectionMonitorsOperations.cs @@ -133,7 +133,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -363,7 +363,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -636,7 +636,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -847,7 +847,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1072,7 +1072,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1249,7 +1249,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1426,7 +1426,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1606,7 +1606,7 @@ internal ConnectionMonitorsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperationsExtensions.cs deleted file mode 100644 index 4985d5567c8e..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperationsExtensions.cs +++ /dev/null @@ -1,270 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// 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; - } - } - - /// - /// 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) - { - return operations.CreateOrUpdateAsync(connectivityConfiguration, 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. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IConnectivityConfigurationsOperations operations, ConnectivityConfiguration connectivityConfiguration, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(connectivityConfiguration, resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)) - { - 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. - /// - public static void Delete(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName) - { - operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName).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. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IConnectivityConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// 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)) - { - return operations.ListAsync(resourceGroupName, networkManagerName, top, skipToken).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)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// 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/sdk/network/Microsoft.Azure.Management.Network/src/Generated/CustomIPPrefixesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/CustomIPPrefixesOperations.cs index 1ba7a0b4636d..18ddc94af696 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/CustomIPPrefixesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/CustomIPPrefixesOperations.cs @@ -119,7 +119,7 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -720,7 +720,7 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1088,15 +1088,11 @@ internal CustomIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (parameters != null) - { - parameters.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosCustomPoliciesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosCustomPoliciesOperations.cs index ccad956f2296..a182c05314f9 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosCustomPoliciesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosCustomPoliciesOperations.cs @@ -116,7 +116,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -342,7 +342,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -540,7 +540,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -723,7 +723,7 @@ internal DdosCustomPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosProtectionPlansOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosProtectionPlansOperations.cs index 8effd010c864..ddc45825cd96 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosProtectionPlansOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DdosProtectionPlansOperations.cs @@ -116,7 +116,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -342,7 +342,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -529,7 +529,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -712,7 +712,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -901,7 +901,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1084,7 +1084,7 @@ internal DdosProtectionPlansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DefaultSecurityRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DefaultSecurityRulesOperations.cs index 7a44c31c1201..43f769b3b7d5 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DefaultSecurityRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DefaultSecurityRulesOperations.cs @@ -94,7 +94,7 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal DefaultSecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DscpConfigurationOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DscpConfigurationOperations.cs index 042b8c3cf635..04435a20f748 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DscpConfigurationOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/DscpConfigurationOperations.cs @@ -141,7 +141,7 @@ internal DscpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -328,7 +328,7 @@ internal DscpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -506,7 +506,7 @@ internal DscpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -703,7 +703,7 @@ internal DscpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -919,7 +919,7 @@ internal DscpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveConnectivityConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveConnectivityConfigurationsOperations.cs deleted file mode 100644 index 67f5629af998..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveConnectivityConfigurationsOperations.cs +++ /dev/null @@ -1,263 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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; - - /// - /// EffectiveConnectivityConfigurationsOperations operations. - /// - internal partial class EffectiveConnectivityConfigurationsOperations : IServiceOperations, IEffectiveConnectivityConfigurationsOperations - { - /// - /// Initializes a new instance of the EffectiveConnectivityConfigurationsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal EffectiveConnectivityConfigurationsOperations(NetworkManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the NetworkManagementClient - /// - public NetworkManagementClient Client { get; private set; } - - /// - /// List all effective connectivity configurations applied on a virtual - /// network. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (virtualNetworkName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualNetworkName", virtualNetworkName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = Client.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(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _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); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveConnectivityConfigurationsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveConnectivityConfigurationsOperationsExtensions.cs deleted file mode 100644 index 8e0d53955d1e..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveConnectivityConfigurationsOperationsExtensions.cs +++ /dev/null @@ -1,73 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for EffectiveConnectivityConfigurationsOperations. - /// - public static partial class EffectiveConnectivityConfigurationsOperationsExtensions - { - /// - /// 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. - /// - /// - /// Parameters supplied to list correct page. - /// - public static NetworkManagerEffectiveConnectivityConfigurationListResult List(this IEffectiveConnectivityConfigurationsOperations operations, string resourceGroupName, string virtualNetworkName, object parameters) - { - return operations.ListAsync(resourceGroupName, virtualNetworkName, parameters).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. - /// - /// - /// Parameters supplied to list correct page. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IEffectiveConnectivityConfigurationsOperations operations, string resourceGroupName, string virtualNetworkName, object parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveVirtualNetworksOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveVirtualNetworksOperationsExtensions.cs deleted file mode 100644 index 14446653d772..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveVirtualNetworksOperationsExtensions.cs +++ /dev/null @@ -1,143 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for EffectiveVirtualNetworksOperations. - /// - public static partial class EffectiveVirtualNetworksOperationsExtensions - { - /// - /// List effective virtual networks in a network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// Effective Virtual Networks Parameter. - /// - /// - /// 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 EffectiveVirtualNetworksListResult ListByNetworkManager(this IEffectiveVirtualNetworksOperations operations, string resourceGroupName, string networkManagerName, EffectiveVirtualNetworksParameter parameters, int? top = default(int?), string skipToken = default(string)) - { - return operations.ListByNetworkManagerAsync(resourceGroupName, networkManagerName, parameters, top, skipToken).GetAwaiter().GetResult(); - } - - /// - /// List effective virtual networks in a network manager. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// Effective Virtual Networks Parameter. - /// - /// - /// 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 ListByNetworkManagerAsync(this IEffectiveVirtualNetworksOperations operations, string resourceGroupName, string networkManagerName, EffectiveVirtualNetworksParameter parameters, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByNetworkManagerWithHttpMessagesAsync(resourceGroupName, networkManagerName, parameters, top, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all effective virtual networks by 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 to get. - /// - /// - /// Parameters supplied to list correct page. - /// - public static EffectiveVirtualNetworksListResult ListByNetworkGroup(this IEffectiveVirtualNetworksOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, QueryRequestOptions parameters) - { - return operations.ListByNetworkGroupAsync(resourceGroupName, networkManagerName, networkGroupName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Lists all effective virtual networks by 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 to get. - /// - /// - /// Parameters supplied to list correct page. - /// - /// - /// The cancellation token. - /// - public static async Task ListByNetworkGroupAsync(this IEffectiveVirtualNetworksOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, QueryRequestOptions parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByNetworkGroupWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitAuthorizationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitAuthorizationsOperations.cs index 727b5f00e5fc..f99995441b4c 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitAuthorizationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitAuthorizationsOperations.cs @@ -127,7 +127,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -352,7 +352,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -551,7 +551,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -744,7 +744,7 @@ internal ExpressRouteCircuitAuthorizationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitConnectionsOperations.cs index 8fd1e24b67e6..a846a08eca64 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitConnectionsOperations.cs @@ -138,7 +138,7 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -377,7 +377,7 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -585,7 +585,7 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -788,7 +788,7 @@ internal ExpressRouteCircuitConnectionsOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitPeeringsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitPeeringsOperations.cs index 65618c5c3a84..09985b56e196 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitPeeringsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitPeeringsOperations.cs @@ -126,7 +126,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +549,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -746,7 +746,7 @@ internal ExpressRouteCircuitPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitsOperations.cs index 3ec95cf70b5d..f33bfb9fe03e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCircuitsOperations.cs @@ -116,7 +116,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -343,7 +343,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -631,7 +631,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -832,7 +832,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1021,7 +1021,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1199,7 +1199,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1386,7 +1386,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1570,7 +1570,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1804,7 +1804,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2017,7 +2017,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2230,7 +2230,7 @@ internal ExpressRouteCircuitsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteConnectionsOperations.cs index 3ea85853d7dd..30f4e3953dc7 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteConnectionsOperations.cs @@ -130,7 +130,7 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -564,7 +564,7 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -789,7 +789,7 @@ internal ExpressRouteConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs index 424a65d5311d..524145ab5c54 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionPeeringsOperations.cs @@ -94,7 +94,7 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -320,7 +320,7 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +549,7 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -746,7 +746,7 @@ internal ExpressRouteCrossConnectionPeeringsOperations(NetworkManagementClient c { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionsOperations.cs index 3e954d5166fe..2bf72f39801d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteCrossConnectionsOperations.cs @@ -80,7 +80,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -263,7 +263,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -455,7 +455,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -681,7 +681,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -976,7 +976,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1192,7 +1192,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1405,7 +1405,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1618,7 +1618,7 @@ internal ExpressRouteCrossConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteGatewaysOperations.cs index 537dedbce767..4bb638d95a5e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteGatewaysOperations.cs @@ -80,7 +80,7 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -263,7 +263,7 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -505,7 +505,7 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -734,7 +734,7 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -960,7 +960,7 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "expressRouteGatewayParameters"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1160,7 +1160,7 @@ internal ExpressRouteGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteLinksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteLinksOperations.cs index 1f1298dc0741..491377eb2275 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteLinksOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteLinksOperations.cs @@ -101,7 +101,7 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "linkName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -298,7 +298,7 @@ internal ExpressRouteLinksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsLocationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsLocationsOperations.cs index 1c89b656f426..81d88fcfc231 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsLocationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsLocationsOperations.cs @@ -82,7 +82,7 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -266,7 +266,7 @@ internal ExpressRoutePortsLocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "locationName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsOperations.cs index 787248fedffc..e9cf3ef5d7c0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRoutePortsOperations.cs @@ -116,7 +116,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -342,7 +342,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -536,7 +536,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -714,7 +714,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -916,7 +916,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { request.Validate(); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1114,7 +1114,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "expressRoutePortName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1297,7 +1297,7 @@ internal ExpressRoutePortsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteServiceProvidersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteServiceProvidersOperations.cs index 5fa49ce548c5..3a7f40c535fe 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteServiceProvidersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ExpressRouteServiceProvidersOperations.cs @@ -80,7 +80,7 @@ internal ExpressRouteServiceProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPoliciesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPoliciesOperations.cs index d0653512977d..2a4df3c4698a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPoliciesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPoliciesOperations.cs @@ -119,7 +119,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -336,7 +336,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -514,7 +514,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -701,7 +701,7 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -880,11 +880,15 @@ internal FirewallPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + if (parameters != null) + { + parameters.Validate(); + } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyRuleCollectionGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyRuleCollectionGroupsOperations.cs index cf21a38eb076..0453aa93d725 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyRuleCollectionGroupsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FirewallPolicyRuleCollectionGroupsOperations.cs @@ -126,7 +126,7 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +549,7 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -746,7 +746,7 @@ internal FirewallPolicyRuleCollectionGroupsOperations(NetworkManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FlowLogsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FlowLogsOperations.cs index 7cb8a17e5295..542951727b92 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FlowLogsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/FlowLogsOperations.cs @@ -136,7 +136,7 @@ internal FlowLogsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -341,7 +341,7 @@ internal FlowLogsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -557,7 +557,7 @@ internal FlowLogsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -764,7 +764,7 @@ internal FlowLogsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -984,7 +984,7 @@ internal FlowLogsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubRouteTablesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubRouteTablesOperations.cs index 908cdbecf80a..b9208e25df5b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubRouteTablesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubRouteTablesOperations.cs @@ -130,7 +130,7 @@ internal HubRouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal HubRouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,7 +560,7 @@ internal HubRouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableParameters"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -785,7 +785,7 @@ internal HubRouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubVirtualNetworkConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubVirtualNetworkConnectionsOperations.cs index e004b4b0ce74..5105180c4c45 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubVirtualNetworkConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/HubVirtualNetworkConnectionsOperations.cs @@ -155,7 +155,7 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,7 +560,7 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "hubVirtualNetworkConnectionParameters"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -785,7 +785,7 @@ internal HubVirtualNetworkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveConnectivityConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveConnectivityConfigurationsOperations.cs deleted file mode 100644 index 359b182a5d4d..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveConnectivityConfigurationsOperations.cs +++ /dev/null @@ -1,55 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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; - - /// - /// ActiveConnectivityConfigurationsOperations operations. - /// - public partial interface IActiveConnectivityConfigurationsOperations - { - /// - /// Lists active connectivity configurations in a network manager. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// Active Configuration Parameter. - /// - /// - /// 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(string resourceGroupName, string networkManagerName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityAdminRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityAdminRulesOperations.cs deleted file mode 100644 index f335a3886261..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityAdminRulesOperations.cs +++ /dev/null @@ -1,55 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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; - - /// - /// ActiveSecurityAdminRulesOperations operations. - /// - public partial interface IActiveSecurityAdminRulesOperations - { - /// - /// Lists active security admin rules in a network manager. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// Active Configuration Parameter. - /// - /// - /// 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(string resourceGroupName, string networkManagerName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityUserRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityUserRulesOperations.cs deleted file mode 100644 index da30dc26eb9c..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IActiveSecurityUserRulesOperations.cs +++ /dev/null @@ -1,55 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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; - - /// - /// ActiveSecurityUserRulesOperations operations. - /// - public partial interface IActiveSecurityUserRulesOperations - { - /// - /// Lists Active Security User Rules in a network manager. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// Active Configuration Parameter. - /// - /// - /// 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(string resourceGroupName, string networkManagerName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRuleCollectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRuleCollectionsOperations.cs deleted file mode 100644 index 860ac9b22b48..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRuleCollectionsOperations.cs +++ /dev/null @@ -1,186 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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. - /// - public partial interface IAdminRuleCollectionsOperations - { - /// - /// Lists all the rule collections in a security admin configuration, - /// in a paginated format. - /// - /// - /// 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 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(string resourceGroupName, string networkManagerName, string configurationName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a network manager security admin configuration rule - /// collection. - /// - /// - /// 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 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> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates an admin rule collection. - /// - /// - /// 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 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> CreateOrUpdateWithHttpMessagesAsync(RuleCollection ruleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes an admin rule collection. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all the rule collections in a security admin configuration, - /// in a paginated format. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRulesOperations.cs deleted file mode 100644 index 5b4c575a6a0d..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IAdminRulesOperations.cs +++ /dev/null @@ -1,196 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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. - /// - public partial interface IAdminRulesOperations - { - /// - /// List all network manager security configuration admin rules. - /// - /// - /// 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 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(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a network manager security configuration admin rule. - /// - /// - /// 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 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> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates an admin rule. - /// - /// - /// 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 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> CreateOrUpdateWithHttpMessagesAsync(BaseAdminRule adminRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes an admin rule. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// List all network manager security configuration admin rules. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IBastionHostsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IBastionHostsOperations.cs index 2e235d2760fa..ecbfa87faa1f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IBastionHostsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IBastionHostsOperations.cs @@ -99,6 +99,34 @@ public partial interface IBastionHostsOperations /// Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionHost parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Updates Tags for BastionHost resource + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + /// + /// Parameters supplied to update BastionHost tags. + /// + /// + /// 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> UpdateTagsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Lists all Bastion Hosts in a subscription. /// /// @@ -190,6 +218,34 @@ public partial interface IBastionHostsOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, BastionHost parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Updates Tags for BastionHost resource + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the Bastion Host. + /// + /// + /// Parameters supplied to update BastionHost tags. + /// + /// + /// 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> BeginUpdateTagsWithHttpMessagesAsync(string resourceGroupName, string bastionHostName, TagsObject parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Lists all Bastion Hosts in a subscription. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IConnectivityConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IConnectivityConfigurationsOperations.cs deleted file mode 100644 index 238d0e1b8e7f..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IConnectivityConfigurationsOperations.cs +++ /dev/null @@ -1,175 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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. - /// - public partial interface IConnectivityConfigurationsOperations - { - /// - /// Gets a Network Connectivity Configuration, specified by the - /// resource group, network manager name, and connectivity - /// Configuration name - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager connectivity configuration. - /// - /// - /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates/Updates a new network manager connectivity configuration - /// - /// - /// 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 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> CreateOrUpdateWithHttpMessagesAsync(ConnectivityConfiguration connectivityConfiguration, string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a network manager connectivity configuration, specified by - /// the resource group, network manager name, and connectivity - /// configuration name - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager connectivity configuration. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all the network manager connectivity configuration in a - /// specified network manager. - /// - /// - /// 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 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(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all the network manager connectivity configuration in a - /// specified network manager. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IEffectiveConnectivityConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IEffectiveConnectivityConfigurationsOperations.cs deleted file mode 100644 index 05563dea56ff..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IEffectiveConnectivityConfigurationsOperations.cs +++ /dev/null @@ -1,56 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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; - - /// - /// EffectiveConnectivityConfigurationsOperations operations. - /// - public partial interface IEffectiveConnectivityConfigurationsOperations - { - /// - /// List all effective connectivity configurations applied on a virtual - /// network. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to list correct page. - /// - /// - /// 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(string resourceGroupName, string virtualNetworkName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IEffectiveVirtualNetworksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IEffectiveVirtualNetworksOperations.cs deleted file mode 100644 index be5ab18bf8d0..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IEffectiveVirtualNetworksOperations.cs +++ /dev/null @@ -1,96 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// EffectiveVirtualNetworksOperations operations. - /// - public partial interface IEffectiveVirtualNetworksOperations - { - /// - /// List effective virtual networks in a network manager. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// Effective Virtual Networks Parameter. - /// - /// - /// 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 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> ListByNetworkManagerWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, EffectiveVirtualNetworksParameter parameters, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all effective virtual networks by specified network group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group to get. - /// - /// - /// Parameters supplied to list correct page. - /// - /// - /// 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> ListByNetworkGroupWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, QueryRequestOptions parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ILoadBalancersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ILoadBalancersOperations.cs index cdeff94f892d..4c3e80785eb5 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ILoadBalancersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ILoadBalancersOperations.cs @@ -172,6 +172,28 @@ public partial interface ILoadBalancersOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Swaps VIPs between two load balancers. + /// + /// + /// The region where load balancers are located at. + /// + /// + /// Parameters that define which VIPs should be swapped. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// 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)); + /// /// Deletes the specified load balancer. /// /// @@ -223,6 +245,28 @@ public partial interface ILoadBalancersOperations /// Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string loadBalancerName, LoadBalancer parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Swaps VIPs between two load balancers. + /// + /// + /// The region where load balancers are located at. + /// + /// + /// Parameters that define which VIPs should be swapped. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// 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)); + /// /// Gets all the load balancers in a subscription. /// /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkGroupsOperations.cs deleted file mode 100644 index cfcf113ee4c4..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkGroupsOperations.cs +++ /dev/null @@ -1,174 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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. - /// - public partial interface INetworkGroupsOperations - { - /// - /// Gets the specified network group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group to get. - /// - /// - /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates a network group. - /// - /// - /// 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 to get. - /// - /// - /// 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 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> CreateOrUpdateWithHttpMessagesAsync(NetworkGroup parameters, string resourceGroupName, string networkManagerName, string networkGroupName, string ifMatch = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a network group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group to get. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists the specified network group. - /// - /// - /// 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 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(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists the specified network group. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagementClient.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagementClient.cs index 243c475cd8e8..0c3fed7f1a0d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagementClient.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagementClient.cs @@ -300,101 +300,6 @@ public partial interface INetworkManagementClient : System.IDisposable /// INetworkInterfaceTapConfigurationsOperations NetworkInterfaceTapConfigurations { get; } - /// - /// Gets the INetworkManagersOperations. - /// - INetworkManagersOperations NetworkManagers { get; } - - /// - /// Gets the INetworkManagerCommitsOperations. - /// - INetworkManagerCommitsOperations NetworkManagerCommits { get; } - - /// - /// Gets the INetworkManagerDeploymentStatusOperations. - /// - INetworkManagerDeploymentStatusOperations NetworkManagerDeploymentStatus { get; } - - /// - /// Gets the IEffectiveVirtualNetworksOperations. - /// - IEffectiveVirtualNetworksOperations EffectiveVirtualNetworks { get; } - - /// - /// Gets the IActiveConnectivityConfigurationsOperations. - /// - IActiveConnectivityConfigurationsOperations ActiveConnectivityConfigurations { get; } - - /// - /// Gets the IActiveSecurityAdminRulesOperations. - /// - IActiveSecurityAdminRulesOperations ActiveSecurityAdminRules { get; } - - /// - /// Gets the IActiveSecurityUserRulesOperations. - /// - IActiveSecurityUserRulesOperations ActiveSecurityUserRules { get; } - - /// - /// Gets the IConnectivityConfigurationsOperations. - /// - IConnectivityConfigurationsOperations ConnectivityConfigurations { get; } - - /// - /// Gets the IEffectiveConnectivityConfigurationsOperations. - /// - IEffectiveConnectivityConfigurationsOperations EffectiveConnectivityConfigurations { get; } - - /// - /// Gets the INetworkManagerEffectiveSecurityAdminRulesOperations. - /// - INetworkManagerEffectiveSecurityAdminRulesOperations NetworkManagerEffectiveSecurityAdminRules { get; } - - /// - /// Gets the INetworkGroupsOperations. - /// - INetworkGroupsOperations NetworkGroups { get; } - - /// - /// Gets the ISecurityUserConfigurationsOperations. - /// - ISecurityUserConfigurationsOperations SecurityUserConfigurations { get; } - - /// - /// Gets the IUserRuleCollectionsOperations. - /// - IUserRuleCollectionsOperations UserRuleCollections { get; } - - /// - /// Gets the IUserRulesOperations. - /// - IUserRulesOperations UserRules { get; } - - /// - /// Gets the ISecurityAdminConfigurationsOperations. - /// - ISecurityAdminConfigurationsOperations SecurityAdminConfigurations { get; } - - /// - /// Gets the IAdminRuleCollectionsOperations. - /// - IAdminRuleCollectionsOperations AdminRuleCollections { get; } - - /// - /// Gets the IAdminRulesOperations. - /// - IAdminRulesOperations AdminRules { get; } - - /// - /// Gets the INetworkSecurityPerimetersOperations. - /// - INetworkSecurityPerimetersOperations NetworkSecurityPerimeters { get; } - - /// - /// Gets the IPerimeterAssociableResourceTypesOperations. - /// - IPerimeterAssociableResourceTypesOperations PerimeterAssociableResourceTypes { get; } - /// /// Gets the INetworkProfilesOperations. /// @@ -530,6 +435,11 @@ public partial interface INetworkManagementClient : System.IDisposable /// IServiceTagsOperations ServiceTags { get; } + /// + /// Gets the IServiceTagInformationOperations. + /// + IServiceTagInformationOperations ServiceTagInformation { get; } + /// /// Gets the IUsagesOperations. /// @@ -575,6 +485,11 @@ public partial interface INetworkManagementClient : System.IDisposable /// ILocalNetworkGatewaysOperations LocalNetworkGateways { get; } + /// + /// Gets the IVirtualNetworkGatewayNatRulesOperations. + /// + IVirtualNetworkGatewayNatRulesOperations VirtualNetworkGatewayNatRules { get; } + /// /// Gets the IVirtualNetworkTapsOperations. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerCommitsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerCommitsOperations.cs deleted file mode 100644 index 98c04c5684ec..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerCommitsOperations.cs +++ /dev/null @@ -1,55 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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. - /// - public partial interface INetworkManagerCommitsOperations - { - /// - /// 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. - /// - /// - /// 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> PostWithHttpMessagesAsync(NetworkManagerCommit parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerDeploymentStatusOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerDeploymentStatusOperations.cs deleted file mode 100644 index a88ee70040aa..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerDeploymentStatusOperations.cs +++ /dev/null @@ -1,56 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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. - /// - public partial interface INetworkManagerDeploymentStatusOperations - { - /// - /// Post to List of Network Manager Deployment Status. - /// - /// - /// Parameters supplied to specify which Managed Network deployment - /// status is. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// 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(NetworkManagerDeploymentStatusParameter parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerEffectiveSecurityAdminRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerEffectiveSecurityAdminRulesOperations.cs deleted file mode 100644 index 5e957d43d159..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagerEffectiveSecurityAdminRulesOperations.cs +++ /dev/null @@ -1,56 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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; - - /// - /// NetworkManagerEffectiveSecurityAdminRulesOperations operations. - /// - public partial interface INetworkManagerEffectiveSecurityAdminRulesOperations - { - /// - /// List all effective security admin rules applied on a virtual - /// network. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// Parameters supplied to list correct page. - /// - /// - /// 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(string resourceGroupName, string virtualNetworkName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagersOperations.cs deleted file mode 100644 index df3c60f9c203..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkManagersOperations.cs +++ /dev/null @@ -1,235 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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. - /// - public partial interface INetworkManagersOperations - { - /// - /// Gets the specified Network Manager. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// 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. - /// - /// - /// 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> CreateOrUpdateWithHttpMessagesAsync(NetworkManager parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a network manager. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Patch a NetworkManager Tags. - /// - /// - /// Parameters supplied to update network manager tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// 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> PatchTagsWithHttpMessagesAsync(TagsObject parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// List all network managers in a subscription. - /// - /// - /// 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 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(int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// 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. - /// - /// - /// 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. - /// - /// - /// The cancellation 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, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// List all network managers in a subscription. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// List network managers in a resource group. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPerimeterAssociableResourceTypesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPerimeterAssociableResourceTypesOperations.cs deleted file mode 100644 index 65d326f86a25..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IPerimeterAssociableResourceTypesOperations.cs +++ /dev/null @@ -1,50 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// PerimeterAssociableResourceTypesOperations operations. - /// - public partial interface IPerimeterAssociableResourceTypesOperations - { - /// - /// Gets the list of resources that are onboarded with NSP. These - /// resources can be associated with a network security perimeter - /// - /// - /// The location of the where the association is present. - /// - /// - /// 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> GetWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityAdminConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityAdminConfigurationsOperations.cs deleted file mode 100644 index 7d3ac606c48c..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityAdminConfigurationsOperations.cs +++ /dev/null @@ -1,170 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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. - /// - public partial interface ISecurityAdminConfigurationsOperations - { - /// - /// Lists all the network manager security admin configurations in a - /// network manager, in a paginated format. - /// - /// - /// 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 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(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves a network manager security admin configuration. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager security Configuration. - /// - /// - /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates a network manager security admin configuration. - /// - /// - /// 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 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> CreateOrUpdateWithHttpMessagesAsync(SecurityConfiguration securityAdminConfiguration, string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a network manager security admin configuration. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager security Configuration. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// 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. - /// - /// - /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityUserConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityUserConfigurationsOperations.cs deleted file mode 100644 index 1d2445133ddc..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ISecurityUserConfigurationsOperations.cs +++ /dev/null @@ -1,170 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// SecurityUserConfigurationsOperations operations. - /// - public partial interface ISecurityUserConfigurationsOperations - { - /// - /// Lists all the network manager security user configurations in a - /// network manager, in a paginated format. - /// - /// - /// 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 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(string resourceGroupName, string networkManagerName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves a network manager security user configuration. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager security Configuration. - /// - /// - /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates a network manager security user configuration. - /// - /// - /// The security user 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 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> CreateOrUpdateWithHttpMessagesAsync(SecurityConfiguration securityUserConfiguration, string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a network manager security user configuration. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager security Configuration. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all the network manager security user configurations in a - /// network manager, in a paginated format. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IServiceTagInformationOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IServiceTagInformationOperations.cs new file mode 100644 index 000000000000..cea1b58a941d --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IServiceTagInformationOperations.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 +{ + 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. + /// + public partial interface IServiceTagInformationOperations + { + /// + /// 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). + /// + /// + /// Do not return address prefixes for the tag(s). + /// + /// + /// Return tag information for a particular tag. + /// + /// + /// 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(string location, bool? noAddressPrefixes = default(bool?), string tagName = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of service tag information resources with pagination. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IUserRuleCollectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IUserRuleCollectionsOperations.cs deleted file mode 100644 index 9013ffe428b7..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IUserRuleCollectionsOperations.cs +++ /dev/null @@ -1,185 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// UserRuleCollectionsOperations operations. - /// - public partial interface IUserRuleCollectionsOperations - { - /// - /// Lists all the user rule collections in a security configuration, in - /// a paginated format. - /// - /// - /// 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 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(string resourceGroupName, string networkManagerName, string configurationName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a network manager security user configuration rule collection. - /// - /// - /// 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 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> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates a user rule collection. - /// - /// - /// The User 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 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> CreateOrUpdateWithHttpMessagesAsync(RuleCollection userRuleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a user rule collection. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all the user rule collections in a security configuration, in - /// a paginated format. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IUserRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IUserRulesOperations.cs deleted file mode 100644 index ae01bd107ac5..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IUserRulesOperations.cs +++ /dev/null @@ -1,196 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// UserRulesOperations operations. - /// - public partial interface IUserRulesOperations - { - /// - /// Lists all user rules in a rule collection. - /// - /// - /// 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 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(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a user rule. - /// - /// - /// 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 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> GetWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates a user rule. - /// - /// - /// The user 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 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> CreateOrUpdateWithHttpMessagesAsync(BaseUserRule userRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes a user rule. - /// - /// - /// 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 headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all user rules in a rule collection. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkSecurityPerimetersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkGatewayNatRulesOperations.cs similarity index 58% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkSecurityPerimetersOperations.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkGatewayNatRulesOperations.cs index c9aca3bb444e..cfe04ed49e72 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/INetworkSecurityPerimetersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkGatewayNatRulesOperations.cs @@ -19,18 +19,21 @@ namespace Microsoft.Azure.Management.Network using System.Threading.Tasks; /// - /// NetworkSecurityPerimetersOperations operations. + /// VirtualNetworkGatewayNatRulesOperations operations. /// - public partial interface INetworkSecurityPerimetersOperations + public partial interface IVirtualNetworkGatewayNatRulesOperations { /// - /// Gets the specified network security perimeter by the name. + /// Retrieves the details of a nat rule. /// /// - /// The name of the resource group. + /// The resource group name of the Virtual Network Gateway. /// - /// - /// The name of the network security perimeter. + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. /// /// /// The headers that will be added to request. @@ -47,19 +50,22 @@ public partial interface INetworkSecurityPerimetersOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityPerimeterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a Network Security Perimeter. + /// Creates a nat rule to a scalable virtual network gateway if it + /// doesn't exist else updates the existing nat rules. /// - /// - /// Parameter supplied to create or update the network security - /// perimeter. - /// /// - /// The name of the resource group. + /// The resource group name of the Virtual Network Gateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. /// - /// - /// The name of the network security perimeter. + /// + /// Parameters supplied to create or Update a Nat Rule. /// /// /// The headers that will be added to request. @@ -76,15 +82,18 @@ public partial interface INetworkSecurityPerimetersOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(NetworkSecurityPerimeter parameters, string resourceGroupName, string networkSecurityPerimeterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a network security perimeter. + /// Deletes a nat rule. /// /// - /// The name of the resource group. + /// The resource group name of the Virtual Network Gateway. /// - /// - /// The name of the network security perimeter. + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. /// /// /// The headers that will be added to request. @@ -98,19 +107,15 @@ public partial interface INetworkSecurityPerimetersOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityPerimeterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List all network security perimeters in a subscription. + /// Retrieves all nat rules for a particular virtual network gateway. /// - /// - /// An optional query parameter which specifies the maximum number of - /// records to be returned by the server. + /// + /// The resource group name of the virtual network gateway. /// - /// - /// 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 name of the gateway. /// /// /// The headers that will be added to request. @@ -127,22 +132,22 @@ public partial interface INetworkSecurityPerimetersOperations /// /// Thrown when a required parameter is null /// - Task>> ListBySubscriptionWithHttpMessagesAsync(int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByVirtualNetworkGatewayWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List network security perimeters in a resource group. + /// Creates a nat rule to a scalable virtual network gateway if it + /// doesn't exist else updates the existing nat rules. /// /// - /// The name of the resource group. + /// The resource group name of the Virtual Network Gateway. /// - /// - /// An optional query parameter which specifies the maximum number of - /// records to be returned by the server. + /// + /// The name of the gateway. /// - /// - /// 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 name of the nat rule. + /// + /// + /// Parameters supplied to create or Update a Nat Rule. /// /// /// The headers that will be added to request. @@ -159,12 +164,18 @@ public partial interface INetworkSecurityPerimetersOperations /// /// 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)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List all network security perimeters in a subscription. + /// Deletes a nat rule. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// The resource group name of the Virtual Network Gateway. + /// + /// + /// The name of the gateway. + /// + /// + /// The name of the nat rule. /// /// /// The headers that will be added to request. @@ -175,15 +186,12 @@ public partial interface INetworkSecurityPerimetersOperations /// /// 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)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List network security perimeters in a resource group. + /// Retrieves all nat rules for a particular virtual network gateway. /// /// /// The NextLink from the previous successful call to List operation. @@ -203,6 +211,6 @@ public partial interface INetworkSecurityPerimetersOperations /// /// Thrown when a required parameter is null /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByVirtualNetworkGatewayNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkPeeringsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkPeeringsOperations.cs index 30d8cf856f60..7d4f2c17d1c0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkPeeringsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IVirtualNetworkPeeringsOperations.cs @@ -92,6 +92,11 @@ public partial interface IVirtualNetworkPeeringsOperations /// 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. /// @@ -107,7 +112,7 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all virtual network peerings in a virtual network. /// @@ -174,6 +179,11 @@ public partial interface IVirtualNetworkPeeringsOperations /// 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. /// @@ -189,7 +199,7 @@ public partial interface IVirtualNetworkPeeringsOperations /// /// Thrown when a required parameter is null /// - Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all virtual network peerings in a virtual network. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundNatRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundNatRulesOperations.cs index af63e984b55e..14e2b402943b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundNatRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundNatRulesOperations.cs @@ -94,7 +94,7 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -323,7 +323,7 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -556,7 +556,7 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -744,15 +744,11 @@ internal InboundNatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "inboundNatRuleParameters"); } - if (inboundNatRuleParameters != null) - { - inboundNatRuleParameters.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundSecurityRuleOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundSecurityRuleOperations.cs index c11fc6f5f661..015356a2ccf8 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundSecurityRuleOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/InboundSecurityRuleOperations.cs @@ -140,7 +140,7 @@ internal InboundSecurityRuleOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpAllocationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpAllocationsOperations.cs index 03bf9f74963b..191fc669a490 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpAllocationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpAllocationsOperations.cs @@ -119,7 +119,7 @@ internal IpAllocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal IpAllocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal IpAllocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -720,7 +720,7 @@ internal IpAllocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal IpAllocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1092,7 +1092,7 @@ internal IpAllocationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpGroupsOperations.cs index 97f7c7a2feb1..c9215957df95 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpGroupsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/IpGroupsOperations.cs @@ -98,7 +98,7 @@ internal IpGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -324,7 +324,7 @@ internal IpGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -535,7 +535,7 @@ internal IpGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -708,7 +708,7 @@ internal IpGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -900,7 +900,7 @@ internal IpGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1111,7 +1111,7 @@ internal IpGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerBackendAddressPoolsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerBackendAddressPoolsOperations.cs index 929e3bd3aa1c..a78cfc664ae8 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerBackendAddressPoolsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerBackendAddressPoolsOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,7 +560,7 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -785,7 +785,7 @@ internal LoadBalancerBackendAddressPoolsOperations(NetworkManagementClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs index d68664f3bb76..d1fa4973fdb0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerFrontendIPConfigurationsOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal LoadBalancerFrontendIPConfigurationsOperations(NetworkManagementClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerLoadBalancingRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerLoadBalancingRulesOperations.cs index 4f7b1bf8ad33..6824046e86fd 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerLoadBalancingRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerLoadBalancingRulesOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal LoadBalancerLoadBalancingRulesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerNetworkInterfacesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerNetworkInterfacesOperations.cs index c318f6963400..8b162a9e1326 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerNetworkInterfacesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerNetworkInterfacesOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerNetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerOutboundRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerOutboundRulesOperations.cs index a0bf8e787632..b02c5cab6866 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerOutboundRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerOutboundRulesOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal LoadBalancerOutboundRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerProbesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerProbesOperations.cs index 00c1cd53433c..e82eddf3e479 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerProbesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancerProbesOperations.cs @@ -94,7 +94,7 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal LoadBalancerProbesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperations.cs index ba393202a49b..260b9f57b243 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperations.cs @@ -119,7 +119,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -720,7 +720,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -868,6 +868,28 @@ internal LoadBalancersOperations(NetworkManagementClient client) return _result; } + /// + /// Swaps VIPs between two load balancers. + /// + /// + /// The region where load balancers are located at. + /// + /// + /// Parameters that define which VIPs should be swapped. + /// + /// + /// The 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)) + { + // Send request + AzureOperationResponse _response = await BeginSwapPublicIpAddressesWithHttpMessagesAsync(location, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Deletes the specified load balancer. /// @@ -909,7 +931,7 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1088,15 +1110,11 @@ internal LoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (parameters != null) - { - parameters.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1271,6 +1289,184 @@ internal LoadBalancersOperations(NetworkManagementClient client) return _result; } + /// + /// Swaps VIPs between two load balancers. + /// + /// + /// The region where load balancers are located at. + /// + /// + /// Parameters that define which VIPs should be swapped. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 BeginSwapPublicIpAddressesWithHttpMessagesAsync(string location, LoadBalancerVipSwapRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2021-03-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginSwapPublicIpAddresses", tracingParameters); + } + // Construct URL + var _baseUrl = 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(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + 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"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _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); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _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); + } + return _result; + } + /// /// Gets all the load balancers in a subscription. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperationsExtensions.cs index 9477a9b9d806..362dbdb0106b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LoadBalancersOperationsExtensions.cs @@ -258,6 +258,43 @@ public static IPage List(this ILoadBalancersOperations operations, } } + /// + /// 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(); + } + /// /// Deletes the specified load balancer. /// @@ -341,6 +378,43 @@ public static LoadBalancer BeginCreateOrUpdate(this ILoadBalancersOperations ope } } + /// + /// 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(); + } + /// /// Gets all the load balancers in a subscription. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LocalNetworkGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LocalNetworkGatewaysOperations.cs index 2ef11e9f2f7b..8a6923b0559c 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LocalNetworkGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/LocalNetworkGatewaysOperations.cs @@ -127,7 +127,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -357,7 +357,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -551,7 +551,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -762,7 +762,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -985,7 +985,7 @@ internal LocalNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityAdminRule.cs deleted file mode 100644 index d08982310a28..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityAdminRule.cs +++ /dev/null @@ -1,124 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Network base admin rule. - /// - public partial class ActiveBaseSecurityAdminRule - { - /// - /// Initializes a new instance of the ActiveBaseSecurityAdminRule - /// class. - /// - public ActiveBaseSecurityAdminRule() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ActiveBaseSecurityAdminRule - /// class. - /// - /// Resource ID. - /// Deployment time string. - /// Deployment region. - /// A display name of the - /// security admin configuration. - /// A description of the - /// security admin configuration. - /// A display name of the rule - /// collection. - /// 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 configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList)) - { - Id = id; - CommitTime = commitTime; - Region = region; - ConfigurationDisplayName = configurationDisplayName; - ConfigurationDescription = configurationDescription; - RuleCollectionDisplayName = ruleCollectionDisplayName; - RuleCollectionDescription = ruleCollectionDescription; - RuleCollectionAppliesToGroups = ruleCollectionAppliesToGroups; - RuleGroups = ruleGroups; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets resource ID. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - /// - /// Gets or sets deployment time string. - /// - [JsonProperty(PropertyName = "commitTime")] - public System.DateTime? CommitTime { get; set; } - - /// - /// Gets or sets deployment region. - /// - [JsonProperty(PropertyName = "region")] - public string Region { get; set; } - - /// - /// Gets or sets a display name of the security admin configuration. - /// - [JsonProperty(PropertyName = "configurationDisplayName")] - public string ConfigurationDisplayName { get; set; } - - /// - /// Gets or sets a description of the security admin configuration. - /// - [JsonProperty(PropertyName = "configurationDescription")] - public string ConfigurationDescription { get; set; } - - /// - /// Gets or sets a display name of the rule collection. - /// - [JsonProperty(PropertyName = "ruleCollectionDisplayName")] - public string RuleCollectionDisplayName { get; set; } - - /// - /// Gets or sets a description of the rule collection. - /// - [JsonProperty(PropertyName = "ruleCollectionDescription")] - public string RuleCollectionDescription { get; set; } - - /// - /// Gets or sets groups for rule collection - /// - [JsonProperty(PropertyName = "ruleCollectionAppliesToGroups")] - public IList RuleCollectionAppliesToGroups { get; set; } - - /// - /// Gets or sets effective configuration groups. - /// - [JsonProperty(PropertyName = "ruleGroups")] - public IList RuleGroups { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityUserRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityUserRule.cs deleted file mode 100644 index aae11068350f..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveBaseSecurityUserRule.cs +++ /dev/null @@ -1,122 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Network base rule. - /// - public partial class ActiveBaseSecurityUserRule - { - /// - /// Initializes a new instance of the ActiveBaseSecurityUserRule class. - /// - public ActiveBaseSecurityUserRule() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ActiveBaseSecurityUserRule class. - /// - /// Resource ID. - /// Deployment time string. - /// Deployment region. - /// A display name of the - /// security user configuration. - /// A description of the - /// security user configuration. - /// A display name of the rule - /// collection. - /// A description of the rule - /// collection. - /// Groups for rule - /// collection - /// Effective configuration groups. - public ActiveBaseSecurityUserRule(string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList)) - { - Id = id; - CommitTime = commitTime; - Region = region; - ConfigurationDisplayName = configurationDisplayName; - ConfigurationDescription = configurationDescription; - RuleCollectionDisplayName = ruleCollectionDisplayName; - RuleCollectionDescription = ruleCollectionDescription; - RuleCollectionAppliesToGroups = ruleCollectionAppliesToGroups; - RuleGroups = ruleGroups; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets resource ID. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - /// - /// Gets or sets deployment time string. - /// - [JsonProperty(PropertyName = "commitTime")] - public System.DateTime? CommitTime { get; set; } - - /// - /// Gets or sets deployment region. - /// - [JsonProperty(PropertyName = "region")] - public string Region { get; set; } - - /// - /// Gets or sets a display name of the security user configuration. - /// - [JsonProperty(PropertyName = "configurationDisplayName")] - public string ConfigurationDisplayName { get; set; } - - /// - /// Gets or sets a description of the security user configuration. - /// - [JsonProperty(PropertyName = "configurationDescription")] - public string ConfigurationDescription { get; set; } - - /// - /// Gets or sets a display name of the rule collection. - /// - [JsonProperty(PropertyName = "ruleCollectionDisplayName")] - public string RuleCollectionDisplayName { get; set; } - - /// - /// Gets or sets a description of the rule collection. - /// - [JsonProperty(PropertyName = "ruleCollectionDescription")] - public string RuleCollectionDescription { get; set; } - - /// - /// Gets or sets groups for rule collection - /// - [JsonProperty(PropertyName = "ruleCollectionAppliesToGroups")] - public IList RuleCollectionAppliesToGroups { get; set; } - - /// - /// Gets or sets effective configuration groups. - /// - [JsonProperty(PropertyName = "ruleGroups")] - public IList RuleGroups { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConfigurationParameter.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConfigurationParameter.cs deleted file mode 100644 index 1769e86f2518..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConfigurationParameter.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Effective Virtual Networks Parameter. - /// - public partial class ActiveConfigurationParameter - { - /// - /// Initializes a new instance of the ActiveConfigurationParameter - /// class. - /// - public ActiveConfigurationParameter() - { - CustomInit(); - } - - /// - /// 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)) - { - Regions = regions; - SkipToken = skipToken; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets list of regions. - /// - [JsonProperty(PropertyName = "regions")] - public 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. - /// - [JsonProperty(PropertyName = "skipToken")] - public string SkipToken { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfiguration.cs deleted file mode 100644 index 3a32c446a152..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfiguration.cs +++ /dev/null @@ -1,91 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Active connectivity configuration. - /// - public partial class ActiveConnectivityConfiguration : EffectiveConnectivityConfiguration - { - /// - /// Initializes a new instance of the ActiveConnectivityConfiguration - /// class. - /// - public ActiveConnectivityConfiguration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ActiveConnectivityConfiguration - /// class. - /// - /// Connectivity topology type. - /// Possible values include: 'HubAndSpoke', 'Mesh' - /// Resource ID. - /// A friendly name for the resource. - /// A description of the connectivity - /// configuration. - /// 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' - /// Effective configuration - /// groups. - /// Deployment time string. - /// Deployment region. - public ActiveConnectivityConfiguration(string connectivityTopology, string id = default(string), string displayName = default(string), string description = default(string), IList hubs = default(IList), string isGlobal = default(string), IList appliesToGroups = default(IList), string provisioningState = default(string), string deleteExistingPeering = default(string), IList configurationGroups = default(IList), System.DateTime? commitTime = default(System.DateTime?), string region = default(string)) - : base(connectivityTopology, id, displayName, description, hubs, isGlobal, appliesToGroups, provisioningState, deleteExistingPeering, configurationGroups) - { - CommitTime = commitTime; - Region = region; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets deployment time string. - /// - [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(); - } - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfigurationsListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfigurationsListResult.cs deleted file mode 100644 index a6c9ddbd693b..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveConnectivityConfigurationsListResult.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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. - /// - public partial class ActiveConnectivityConfigurationsListResult - { - /// - /// Initializes a new instance of the - /// ActiveConnectivityConfigurationsListResult class. - /// - public ActiveConnectivityConfigurationsListResult() - { - CustomInit(); - } - - /// - /// 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)) - { - Value = value; - SkipToken = skipToken; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets a page of active connectivity configurations. - /// - [JsonProperty(PropertyName = "value")] - public 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. - /// - [JsonProperty(PropertyName = "skipToken")] - public string SkipToken { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityAdminRule.cs deleted file mode 100644 index c3aafcd2dfe2..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityAdminRule.cs +++ /dev/null @@ -1,183 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 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] - public partial class ActiveDefaultSecurityAdminRule : ActiveBaseSecurityAdminRule - { - /// - /// Initializes a new instance of the ActiveDefaultSecurityAdminRule - /// class. - /// - public ActiveDefaultSecurityAdminRule() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ActiveDefaultSecurityAdminRule - /// class. - /// - /// Resource ID. - /// Deployment time string. - /// Deployment region. - /// A display name of the - /// security admin configuration. - /// A description of the - /// security admin configuration. - /// A display name of the rule - /// collection. - /// A description of the rule - /// collection. - /// Groups for rule - /// collection - /// Effective configuration groups. - /// A friendly name for the rule. - /// 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' - public ActiveDefaultSecurityAdminRule(string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string displayName = default(string), 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)) - : base(id, commitTime, region, configurationDisplayName, configurationDescription, ruleCollectionDisplayName, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) - { - DisplayName = displayName; - Description = description; - Flag = flag; - Protocol = protocol; - Sources = sources; - Destinations = destinations; - SourcePortRanges = sourcePortRanges; - DestinationPortRanges = destinationPortRanges; - Access = access; - Priority = priority; - Direction = direction; - ProvisioningState = provisioningState; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets a friendly name for the rule. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; private set; } - - /// - /// Gets a description for this rule. Restricted to 140 chars. - /// - [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; } - - /// - /// 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; } - - /// - /// Gets the CIDR or source IP ranges. - /// - [JsonProperty(PropertyName = "properties.sources")] - public IList Sources { get; private set; } - - /// - /// Gets the destination address prefixes. CIDR or destination IP - /// ranges. - /// - [JsonProperty(PropertyName = "properties.destinations")] - public IList Destinations { get; private set; } - - /// - /// Gets the source port ranges. - /// - [JsonProperty(PropertyName = "properties.sourcePortRanges")] - public 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; } - - /// - /// 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; } - - /// - /// 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; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityUserRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityUserRule.cs deleted file mode 100644 index 3d6b60ab2c19..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveDefaultSecurityUserRule.cs +++ /dev/null @@ -1,160 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Network security default user rule. - /// - [Newtonsoft.Json.JsonObject("Default")] - [Rest.Serialization.JsonTransformation] - public partial class ActiveDefaultSecurityUserRule : ActiveBaseSecurityUserRule - { - /// - /// Initializes a new instance of the ActiveDefaultSecurityUserRule - /// class. - /// - public ActiveDefaultSecurityUserRule() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ActiveDefaultSecurityUserRule - /// class. - /// - /// Resource ID. - /// Deployment time string. - /// Deployment region. - /// A display name of the - /// security user configuration. - /// A description of the - /// security user configuration. - /// A display name of the rule - /// collection. - /// A description of the rule - /// collection. - /// Groups for rule - /// collection - /// Effective configuration groups. - /// A friendly name for the rule. - /// 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 if the traffic matched against - /// the rule in inbound or outbound. Possible values include: - /// 'Inbound', 'Outbound' - /// The provisioning state of the - /// security configuration user rule resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - public ActiveDefaultSecurityUserRule(string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string displayName = default(string), 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 direction = default(string), string provisioningState = default(string)) - : base(id, commitTime, region, configurationDisplayName, configurationDescription, ruleCollectionDisplayName, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) - { - DisplayName = displayName; - Description = description; - Flag = flag; - Protocol = protocol; - Sources = sources; - Destinations = destinations; - SourcePortRanges = sourcePortRanges; - DestinationPortRanges = destinationPortRanges; - Direction = direction; - ProvisioningState = provisioningState; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets a friendly name for the rule. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; private set; } - - /// - /// Gets a description for this rule. Restricted to 140 chars. - /// - [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; } - - /// - /// 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; } - - /// - /// Gets the CIDR or source IP ranges. - /// - [JsonProperty(PropertyName = "properties.sources")] - public IList Sources { get; private set; } - - /// - /// Gets the destination address prefixes. CIDR or destination IP - /// ranges. - /// - [JsonProperty(PropertyName = "properties.destinations")] - public IList Destinations { get; private set; } - - /// - /// Gets the source port ranges. - /// - [JsonProperty(PropertyName = "properties.sourcePortRanges")] - public IList SourcePortRanges { get; private set; } - - /// - /// Gets the destination port ranges. - /// - [JsonProperty(PropertyName = "properties.destinationPortRanges")] - public IList DestinationPortRanges { get; private set; } - - /// - /// 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 security configuration user rule - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRule.cs deleted file mode 100644 index 17c1eb47ef76..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRule.cs +++ /dev/null @@ -1,203 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 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] - public partial class ActiveSecurityAdminRule : ActiveBaseSecurityAdminRule - { - /// - /// Initializes a new instance of the ActiveSecurityAdminRule class. - /// - public ActiveSecurityAdminRule() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ActiveSecurityAdminRule class. - /// - /// 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' - /// 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 display name of the - /// security admin configuration. - /// A description of the - /// security admin configuration. - /// A display name of the rule - /// collection. - /// A description of the rule - /// collection. - /// Groups for rule - /// collection - /// Effective configuration groups. - /// A friendly name for the rule. - /// 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 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. - /// The provisioning state of the - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - public ActiveSecurityAdminRule(string protocol, string access, string direction, string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string displayName = default(string), string description = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), int? priority = default(int?), string provisioningState = default(string)) - : base(id, commitTime, region, configurationDisplayName, configurationDescription, ruleCollectionDisplayName, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) - { - DisplayName = displayName; - Description = description; - Protocol = protocol; - Sources = sources; - Destinations = destinations; - SourcePortRanges = sourcePortRanges; - DestinationPortRanges = destinationPortRanges; - Access = access; - Priority = priority; - Direction = direction; - ProvisioningState = provisioningState; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a friendly name for the rule. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// 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', 'Any', 'Ah' - /// - [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; } - - /// - /// Gets or sets the destination address prefixes. CIDR or destination - /// IP ranges. - /// - [JsonProperty(PropertyName = "properties.destinations")] - public IList Destinations { get; set; } - - /// - /// Gets or sets the source port ranges. - /// - [JsonProperty(PropertyName = "properties.sourcePortRanges")] - public IList SourcePortRanges { get; set; } - - /// - /// Gets or sets the destination port ranges. - /// - [JsonProperty(PropertyName = "properties.destinationPortRanges")] - public IList DestinationPortRanges { get; set; } - - /// - /// 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; } - - /// - /// 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; } - - /// - /// 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; } - - /// - /// 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) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 1); - } - } - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRulesListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRulesListResult.cs deleted file mode 100644 index 343d36d55c0c..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityAdminRulesListResult.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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. - /// - public partial class ActiveSecurityAdminRulesListResult - { - /// - /// Initializes a new instance of the - /// ActiveSecurityAdminRulesListResult class. - /// - public ActiveSecurityAdminRulesListResult() - { - CustomInit(); - } - - /// - /// 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)) - { - Value = value; - SkipToken = skipToken; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets a page of active security admin rules. - /// - [JsonProperty(PropertyName = "value")] - public 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. - /// - [JsonProperty(PropertyName = "skipToken")] - public string SkipToken { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRule.cs deleted file mode 100644 index c13c74801328..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRule.cs +++ /dev/null @@ -1,166 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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 user rule. - /// - [Newtonsoft.Json.JsonObject("Custom")] - [Rest.Serialization.JsonTransformation] - public partial class ActiveSecurityUserRule : ActiveBaseSecurityUserRule - { - /// - /// Initializes a new instance of the ActiveSecurityUserRule class. - /// - public ActiveSecurityUserRule() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ActiveSecurityUserRule class. - /// - /// Network protocol this rule applies to. - /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', - /// 'Ah' - /// 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 display name of the - /// security user configuration. - /// A description of the - /// security user configuration. - /// A display name of the rule - /// collection. - /// A description of the rule - /// collection. - /// Groups for rule - /// collection - /// Effective configuration groups. - /// A friendly name for the rule. - /// A description for this rule. - /// 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 - /// security configuration user rule resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - public ActiveSecurityUserRule(string protocol, string direction, string id = default(string), System.DateTime? commitTime = default(System.DateTime?), string region = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string displayName = default(string), string description = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), string provisioningState = default(string)) - : base(id, commitTime, region, configurationDisplayName, configurationDescription, ruleCollectionDisplayName, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) - { - DisplayName = displayName; - Description = description; - Protocol = protocol; - Sources = sources; - Destinations = destinations; - SourcePortRanges = sourcePortRanges; - DestinationPortRanges = destinationPortRanges; - Direction = direction; - ProvisioningState = provisioningState; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a friendly name for the rule. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets a description for this rule. - /// - [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' - /// - [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; } - - /// - /// Gets or sets the destination address prefixes. CIDR or destination - /// IP ranges. - /// - [JsonProperty(PropertyName = "properties.destinations")] - public IList Destinations { get; set; } - - /// - /// Gets or sets the source port ranges. - /// - [JsonProperty(PropertyName = "properties.sourcePortRanges")] - public IList SourcePortRanges { get; set; } - - /// - /// Gets or sets the destination port ranges. - /// - [JsonProperty(PropertyName = "properties.destinationPortRanges")] - public IList DestinationPortRanges { get; set; } - - /// - /// 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 security configuration user rule - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Protocol == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); - } - if (Direction == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Direction"); - } - } - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRulesListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRulesListResult.cs deleted file mode 100644 index 1674025d5062..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ActiveSecurityUserRulesListResult.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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 user rules. It contains a - /// list of active security user rules and a skiptoken to get the next set - /// of results. - /// - public partial class ActiveSecurityUserRulesListResult - { - /// - /// Initializes a new instance of the ActiveSecurityUserRulesListResult - /// class. - /// - public ActiveSecurityUserRulesListResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ActiveSecurityUserRulesListResult - /// class. - /// - /// Gets a page of active security user - /// 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 ActiveSecurityUserRulesListResult(IList value = default(IList), string skipToken = default(string)) - { - Value = value; - SkipToken = skipToken; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets a page of active security user rules. - /// - [JsonProperty(PropertyName = "value")] - public 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. - /// - [JsonProperty(PropertyName = "skipToken")] - public string SkipToken { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AddressPrefixItem.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AddressPrefixItem.cs deleted file mode 100644 index 1874f1867c22..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AddressPrefixItem.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Address prefix item. - /// - public partial class AddressPrefixItem - { - /// - /// Initializes a new instance of the AddressPrefixItem class. - /// - public AddressPrefixItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AddressPrefixItem class. - /// - /// Address prefix. - /// Address prefix type. Possible - /// values include: 'IPPrefix', 'ServiceTag' - public AddressPrefixItem(string addressPrefix = default(string), string addressPrefixType = default(string)) - { - AddressPrefix = addressPrefix; - AddressPrefixType = addressPrefixType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets address prefix. - /// - [JsonProperty(PropertyName = "addressPrefix")] - public string AddressPrefix { get; set; } - - /// - /// Gets or sets address prefix type. Possible values include: - /// 'IPPrefix', 'ServiceTag' - /// - [JsonProperty(PropertyName = "addressPrefixType")] - public string AddressPrefixType { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AdminRule.cs deleted file mode 100644 index 767e9a566aff..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AdminRule.cs +++ /dev/null @@ -1,196 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 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] - public partial class AdminRule : BaseAdminRule - { - /// - /// Initializes a new instance of the AdminRule class. - /// - public AdminRule() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AdminRule class. - /// - /// 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' - /// 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 friendly name for the rule. - /// 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 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. - /// The provisioning state of the - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - public AdminRule(string protocol, string access, string direction, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string displayName = default(string), string description = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), int? priority = default(int?), string provisioningState = default(string)) - : base(id, name, type, etag, systemData) - { - DisplayName = displayName; - Description = description; - Protocol = protocol; - Sources = sources; - Destinations = destinations; - SourcePortRanges = sourcePortRanges; - DestinationPortRanges = destinationPortRanges; - Access = access; - Priority = priority; - Direction = direction; - ProvisioningState = provisioningState; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a friendly name for the rule. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// 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', 'Any', 'Ah' - /// - [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; } - - /// - /// Gets or sets the destination address prefixes. CIDR or destination - /// IP ranges. - /// - [JsonProperty(PropertyName = "properties.destinations")] - public IList Destinations { get; set; } - - /// - /// Gets or sets the source port ranges. - /// - [JsonProperty(PropertyName = "properties.sourcePortRanges")] - public IList SourcePortRanges { get; set; } - - /// - /// Gets or sets the destination port ranges. - /// - [JsonProperty(PropertyName = "properties.destinationPortRanges")] - public IList DestinationPortRanges { get; set; } - - /// - /// 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; } - - /// - /// 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; } - - /// - /// 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; } - - /// - /// 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) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 1); - } - } - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGateway.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGateway.cs index 24bcc49fc4af..a8469fcc2839 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGateway.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGateway.cs @@ -121,13 +121,16 @@ public ApplicationGateway() /// 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. /// 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 httpListeners = default(IList), IList sslProfiles = default(IList), IList urlPathMaps = default(IList), IList requestRoutingRules = 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?), string etag = default(string), IList zones = default(IList), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) + 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 httpListeners = default(IList), IList sslProfiles = default(IList), IList urlPathMaps = default(IList), IList requestRoutingRules = 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 etag = default(string), IList zones = default(IList), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) : base(id, name, type, location, tags) { Sku = sku; @@ -160,6 +163,8 @@ public ApplicationGateway() ProvisioningState = provisioningState; CustomErrorConfigurations = customErrorConfigurations; ForceFirewallPolicyAssociation = forceFirewallPolicyAssociation; + LoadDistributionPolicies = loadDistributionPolicies; + GlobalConfiguration = globalConfiguration; Etag = etag; Zones = zones; Identity = identity; @@ -388,6 +393,19 @@ public ApplicationGateway() [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; } + + /// + /// Gets or sets global Configuration. + /// + [JsonProperty(PropertyName = "properties.globalConfiguration")] + public ApplicationGatewayGlobalConfiguration GlobalConfiguration { get; set; } + /// /// Gets a unique read-only string that changes whenever the resource /// is updated. @@ -455,16 +473,6 @@ public virtual void Validate() { AutoscaleConfiguration.Validate(); } - if (PrivateEndpointConnections != null) - { - foreach (var element3 in PrivateEndpointConnections) - { - if (element3 != null) - { - element3.Validate(); - } - } - } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayAutoscaleConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayAutoscaleConfiguration.cs index feca79d52be4..310e30ea48b3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayAutoscaleConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayAutoscaleConfiguration.cs @@ -72,9 +72,12 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMinimum, "MinCapacity", 0); } - if (MaxCapacity < 2) + if (MaxCapacity != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxCapacity", 2); + if (MaxCapacity < 2) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxCapacity", 2); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs index c2a9bdc553d5..f031eeef3a70 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthHttpSettings.cs @@ -75,16 +75,6 @@ public virtual void Validate() { BackendHttpSettings.Validate(); } - if (Servers != null) - { - foreach (var element in Servers) - { - if (element != null) - { - element.Validate(); - } - } - } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthServer.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthServer.cs index 2caf05181f53..46b8ad150f46 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthServer.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayBackendHealthServer.cs @@ -76,18 +76,5 @@ public ApplicationGatewayBackendHealthServer() [JsonProperty(PropertyName = "healthProbeLog")] public string HealthProbeLog { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (IpConfiguration != null) - { - IpConfiguration.Validate(); - } - } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayGlobalConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayGlobalConfiguration.cs new file mode 100644 index 000000000000..d61f56a2f19d --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayGlobalConfiguration.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 Newtonsoft.Json; + using System.Linq; + + /// + /// Application Gateway global configuration. + /// + public partial class ApplicationGatewayGlobalConfiguration + { + /// + /// Initializes a new instance of the + /// ApplicationGatewayGlobalConfiguration class. + /// + public ApplicationGatewayGlobalConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ApplicationGatewayGlobalConfiguration class. + /// + /// Enable request + /// buffering. + /// Enable response + /// buffering. + public ApplicationGatewayGlobalConfiguration(bool? enableRequestBuffering = default(bool?), bool? enableResponseBuffering = default(bool?)) + { + EnableRequestBuffering = enableRequestBuffering; + EnableResponseBuffering = enableResponseBuffering; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets enable request buffering. + /// + [JsonProperty(PropertyName = "enableRequestBuffering")] + public bool? EnableRequestBuffering { get; set; } + + /// + /// Gets or sets enable response buffering. + /// + [JsonProperty(PropertyName = "enableResponseBuffering")] + public bool? EnableResponseBuffering { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AddressPrefixType.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayLoadDistributionAlgorithm.cs similarity index 59% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AddressPrefixType.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayLoadDistributionAlgorithm.cs index c094c49264ca..a640014216dc 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AddressPrefixType.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayLoadDistributionAlgorithm.cs @@ -12,11 +12,12 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for AddressPrefixType. + /// Defines values for ApplicationGatewayLoadDistributionAlgorithm. /// - public static class AddressPrefixType + public static class ApplicationGatewayLoadDistributionAlgorithm { - public const string IPPrefix = "IPPrefix"; - public const string ServiceTag = "ServiceTag"; + public const string RoundRobin = "RoundRobin"; + public const string LeastConnections = "LeastConnections"; + public const string IpHash = "IpHash"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayLoadDistributionPolicy.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayLoadDistributionPolicy.cs new file mode 100644 index 000000000000..c6bfc5cbff49 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayLoadDistributionPolicy.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 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] + public partial class ApplicationGatewayLoadDistributionPolicy : SubResource + { + /// + /// Initializes a new instance of the + /// ApplicationGatewayLoadDistributionPolicy class. + /// + public ApplicationGatewayLoadDistributionPolicy() + { + CustomInit(); + } + + /// + /// 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) + { + LoadDistributionTargets = loadDistributionTargets; + LoadDistributionAlgorithm = loadDistributionAlgorithm; + ProvisioningState = provisioningState; + Name = name; + Etag = etag; + Type = type; + 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. + /// + [JsonProperty(PropertyName = "properties.loadDistributionTargets")] + public IList LoadDistributionTargets { get; set; } + + /// + /// Gets or sets load Distribution Targets resource of an application + /// gateway. Possible values include: 'RoundRobin', 'LeastConnections', + /// 'IpHash' + /// + [JsonProperty(PropertyName = "properties.loadDistributionAlgorithm")] + public string LoadDistributionAlgorithm { get; set; } + + /// + /// Gets the provisioning state of the Load Distribution Policy + /// resource. Possible values include: 'Succeeded', 'Updating', + /// 'Deleting', 'Failed' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets name of the load distribution policy that is unique + /// within an Application Gateway. + /// + [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; } + + /// + /// Gets type of the resource. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayLoadDistributionTarget.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayLoadDistributionTarget.cs new file mode 100644 index 000000000000..8ddb867b2931 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayLoadDistributionTarget.cs @@ -0,0 +1,117 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Load Distribution Target of an application gateway. + /// + [Rest.Serialization.JsonTransformation] + public partial class ApplicationGatewayLoadDistributionTarget : SubResource + { + /// + /// Initializes a new instance of the + /// ApplicationGatewayLoadDistributionTarget class. + /// + public ApplicationGatewayLoadDistributionTarget() + { + CustomInit(); + } + + /// + /// 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) + { + WeightPerServer = weightPerServer; + BackendAddressPool = backendAddressPool; + Name = name; + Etag = etag; + Type = type; + 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. + /// + [JsonProperty(PropertyName = "properties.weightPerServer")] + public int? WeightPerServer { get; set; } + + /// + /// Gets or sets backend address pool resource of the application + /// gateway. + /// + [JsonProperty(PropertyName = "properties.backendAddressPool")] + public SubResource BackendAddressPool { get; set; } + + /// + /// Gets or sets name of the load distribution policy that is unique + /// within an Application Gateway. + /// + [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; } + + /// + /// Gets type of the resource. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (WeightPerServer != null) + { + if (WeightPerServer > 100) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "WeightPerServer", 100); + } + if (WeightPerServer < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "WeightPerServer", 1); + } + } + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayPathRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayPathRule.cs index 575a83ff2316..371156250b12 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayPathRule.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayPathRule.cs @@ -44,6 +44,8 @@ public ApplicationGatewayPathRule() /// 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' @@ -54,7 +56,7 @@ public ApplicationGatewayPathRule() /// 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), string provisioningState = default(string), SubResource firewallPolicy = default(SubResource), string name = default(string), string etag = default(string), string type = default(string)) + 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) { Paths = paths; @@ -62,6 +64,7 @@ public ApplicationGatewayPathRule() BackendHttpSettings = backendHttpSettings; RedirectConfiguration = redirectConfiguration; RewriteRuleSet = rewriteRuleSet; + LoadDistributionPolicy = loadDistributionPolicy; ProvisioningState = provisioningState; FirewallPolicy = firewallPolicy; Name = name; @@ -108,6 +111,13 @@ public ApplicationGatewayPathRule() [JsonProperty(PropertyName = "properties.rewriteRuleSet")] public SubResource RewriteRuleSet { get; set; } + /// + /// Gets or sets load Distribution Policy resource of URL path map path + /// rule. + /// + [JsonProperty(PropertyName = "properties.loadDistributionPolicy")] + public SubResource LoadDistributionPolicy { get; set; } + /// /// Gets the provisioning state of the path rule resource. Possible /// values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayPrivateEndpointConnection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayPrivateEndpointConnection.cs index 83d8747fdb4a..4d0fe00919cd 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayPrivateEndpointConnection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayPrivateEndpointConnection.cs @@ -115,18 +115,5 @@ public ApplicationGatewayPrivateEndpointConnection() [JsonProperty(PropertyName = "type")] public string Type { get; private set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (PrivateEndpoint != null) - { - PrivateEndpoint.Validate(); - } - } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayProbe.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayProbe.cs index 1444f590718f..de4d79857277 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayProbe.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayProbe.cs @@ -202,13 +202,16 @@ public ApplicationGatewayProbe() /// public virtual void Validate() { - if (Port > 65535) + if (Port != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 65535); - } - if (Port < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 1); + if (Port > 65535) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 65535); + } + if (Port < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 1); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayRequestRoutingRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayRequestRoutingRule.cs index 60a8efa151e4..3d12aaebb9d9 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayRequestRoutingRule.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayRequestRoutingRule.cs @@ -51,6 +51,8 @@ public ApplicationGatewayRequestRoutingRule() /// 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' @@ -59,7 +61,7 @@ public ApplicationGatewayRequestRoutingRule() /// 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), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) + 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) { RuleType = ruleType; @@ -70,6 +72,7 @@ public ApplicationGatewayRequestRoutingRule() UrlPathMap = urlPathMap; RewriteRuleSet = rewriteRuleSet; RedirectConfiguration = redirectConfiguration; + LoadDistributionPolicy = loadDistributionPolicy; ProvisioningState = provisioningState; Name = name; Etag = etag; @@ -135,6 +138,13 @@ public ApplicationGatewayRequestRoutingRule() [JsonProperty(PropertyName = "properties.redirectConfiguration")] public SubResource RedirectConfiguration { get; set; } + /// + /// Gets or sets load Distribution Policy resource of the application + /// gateway. + /// + [JsonProperty(PropertyName = "properties.loadDistributionPolicy")] + public SubResource LoadDistributionPolicy { get; set; } + /// /// Gets the provisioning state of the request routing rule resource. /// Possible values include: 'Succeeded', 'Updating', 'Deleting', @@ -171,13 +181,16 @@ public ApplicationGatewayRequestRoutingRule() /// public virtual void Validate() { - if (Priority > 20000) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 20000); - } - if (Priority < 1) + if (Priority != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 1); + if (Priority > 20000) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 20000); + } + if (Priority < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 1); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayTrustedClientCertificate.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayTrustedClientCertificate.cs index 070e44985228..96ca38c8ca16 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayTrustedClientCertificate.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayTrustedClientCertificate.cs @@ -36,6 +36,9 @@ public ApplicationGatewayTrustedClientCertificate() /// /// 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' @@ -44,10 +47,12 @@ public ApplicationGatewayTrustedClientCertificate() /// 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 provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) + 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) { Data = data; + ValidatedCertData = validatedCertData; + ClientCertIssuerDN = clientCertIssuerDN; ProvisioningState = provisioningState; Name = name; Etag = etag; @@ -66,6 +71,18 @@ public ApplicationGatewayTrustedClientCertificate() [JsonProperty(PropertyName = "properties.data")] public string Data { get; set; } + /// + /// Gets validated certificate data. + /// + [JsonProperty(PropertyName = "properties.validatedCertData")] + public string ValidatedCertData { get; private set; } + + /// + /// Gets distinguished name of client certificate issuer. + /// + [JsonProperty(PropertyName = "properties.clientCertIssuerDN")] + public string ClientCertIssuerDN { get; private set; } + /// /// Gets the provisioning state of the trusted client certificate /// resource. Possible values include: 'Succeeded', 'Updating', diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayUrlPathMap.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayUrlPathMap.cs index 4d236f39f797..fb55237c56e6 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayUrlPathMap.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayUrlPathMap.cs @@ -46,6 +46,8 @@ public ApplicationGatewayUrlPathMap() /// 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', @@ -55,13 +57,14 @@ public ApplicationGatewayUrlPathMap() /// 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), IList pathRules = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) + 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) { DefaultBackendAddressPool = defaultBackendAddressPool; DefaultBackendHttpSettings = defaultBackendHttpSettings; DefaultRewriteRuleSet = defaultRewriteRuleSet; DefaultRedirectConfiguration = defaultRedirectConfiguration; + DefaultLoadDistributionPolicy = defaultLoadDistributionPolicy; PathRules = pathRules; ProvisioningState = provisioningState; Name = name; @@ -101,6 +104,13 @@ public ApplicationGatewayUrlPathMap() [JsonProperty(PropertyName = "properties.defaultRedirectConfiguration")] public SubResource DefaultRedirectConfiguration { get; set; } + /// + /// Gets or sets default Load Distribution Policy resource of URL path + /// map. + /// + [JsonProperty(PropertyName = "properties.defaultLoadDistributionPolicy")] + public SubResource DefaultLoadDistributionPolicy { get; set; } + /// /// Gets or sets path rule of URL path map resource. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayWebApplicationFirewallConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayWebApplicationFirewallConfiguration.cs index bd4966fd77a9..dad33866910e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayWebApplicationFirewallConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationGatewayWebApplicationFirewallConfiguration.cs @@ -165,25 +165,34 @@ public virtual void Validate() } } } - if (MaxRequestBodySize > 128) + if (MaxRequestBodySize != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxRequestBodySize", 128); - } - if (MaxRequestBodySize < 8) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxRequestBodySize", 8); - } - if (MaxRequestBodySizeInKb > 128) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxRequestBodySizeInKb", 128); + if (MaxRequestBodySize > 128) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxRequestBodySize", 128); + } + if (MaxRequestBodySize < 8) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxRequestBodySize", 8); + } } - if (MaxRequestBodySizeInKb < 8) + if (MaxRequestBodySizeInKb != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxRequestBodySizeInKb", 8); + if (MaxRequestBodySizeInKb > 128) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxRequestBodySizeInKb", 128); + } + if (MaxRequestBodySizeInKb < 8) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxRequestBodySizeInKb", 8); + } } - if (FileUploadLimitInMb < 0) + if (FileUploadLimitInMb != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "FileUploadLimitInMb", 0); + if (FileUploadLimitInMb < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "FileUploadLimitInMb", 0); + } } if (Exclusions != null) { diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationRule.cs index caa6a0d598e6..3bfb4fabf638 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationRule.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ApplicationRule.cs @@ -18,6 +18,7 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Rule of type application. /// + [Newtonsoft.Json.JsonObject("ApplicationRule")] public partial class ApplicationRule : FirewallPolicyRule { /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallApplicationRuleCollection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallApplicationRuleCollection.cs index 6528bdb761cf..30fea8c7ada4 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallApplicationRuleCollection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallApplicationRuleCollection.cs @@ -116,13 +116,16 @@ public AzureFirewallApplicationRuleCollection() /// public virtual void Validate() { - if (Priority > 65000) + if (Priority != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 65000); - } - if (Priority < 100) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 100); + if (Priority > 65000) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 65000); + } + if (Priority < 100) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 100); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallApplicationRuleProtocol.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallApplicationRuleProtocol.cs index f2c9c74fdc19..278a39b679cb 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallApplicationRuleProtocol.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallApplicationRuleProtocol.cs @@ -70,13 +70,16 @@ public AzureFirewallApplicationRuleProtocol() /// public virtual void Validate() { - if (Port > 64000) + if (Port != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 64000); - } - if (Port < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + if (Port > 64000) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 64000); + } + if (Port < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNatRuleCollection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNatRuleCollection.cs index d18672edde1b..01ffee90b3fd 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNatRuleCollection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNatRuleCollection.cs @@ -116,13 +116,16 @@ public AzureFirewallNatRuleCollection() /// public virtual void Validate() { - if (Priority > 65000) + if (Priority != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 65000); - } - if (Priority < 100) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 100); + if (Priority > 65000) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 65000); + } + if (Priority < 100) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 100); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNetworkRuleCollection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNetworkRuleCollection.cs index 00531f0237b2..cb720dc5c385 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNetworkRuleCollection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureFirewallNetworkRuleCollection.cs @@ -115,13 +115,16 @@ public AzureFirewallNetworkRuleCollection() /// public virtual void Validate() { - if (Priority > 65000) + if (Priority != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 65000); - } - if (Priority < 100) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 100); + if (Priority > 65000) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 65000); + } + if (Priority < 100) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 100); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureReachabilityReportLatencyInfo.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureReachabilityReportLatencyInfo.cs index a204272b613f..da00b97ff30c 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureReachabilityReportLatencyInfo.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/AzureReachabilityReportLatencyInfo.cs @@ -68,13 +68,16 @@ public AzureReachabilityReportLatencyInfo() /// public virtual void Validate() { - if (Score > 100) + if (Score != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Score", 100); - } - if (Score < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Score", 1); + if (Score > 100) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Score", 100); + } + if (Score < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Score", 1); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BackendAddressPool.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BackendAddressPool.cs index e944c6b349d3..0cb46bba66e0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BackendAddressPool.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BackendAddressPool.cs @@ -37,6 +37,8 @@ public BackendAddressPool() /// 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 @@ -56,10 +58,11 @@ public BackendAddressPool() /// 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 loadBalancerBackendAddresses = default(IList), IList backendIPConfigurations = default(IList), IList loadBalancingRules = default(IList), SubResource outboundRule = default(SubResource), IList outboundRules = default(IList), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) + 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), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) : base(id) { Location = location; + TunnelInterfaces = tunnelInterfaces; LoadBalancerBackendAddresses = loadBalancerBackendAddresses; BackendIPConfigurations = backendIPConfigurations; LoadBalancingRules = loadBalancingRules; @@ -83,6 +86,12 @@ public BackendAddressPool() [JsonProperty(PropertyName = "properties.location")] public string Location { get; set; } + /// + /// Gets or sets an array of gateway load balancer tunnel interfaces. + /// + [JsonProperty(PropertyName = "properties.tunnelInterfaces")] + public IList TunnelInterfaces { get; set; } + /// /// Gets or sets an array of backend addresses. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseAdminRule.cs deleted file mode 100644 index f756c6fdbc86..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseAdminRule.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Network base admin rule. - /// - public partial class BaseAdminRule : ProxyResource - { - /// - /// Initializes a new instance of the BaseAdminRule class. - /// - public BaseAdminRule() - { - CustomInit(); - } - - /// - /// 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. - 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) - { - SystemData = systemData; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the system metadata related to this resource. - /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseUserRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseUserRule.cs deleted file mode 100644 index 981cfe80403a..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BaseUserRule.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Network base rule. - /// - public partial class BaseUserRule : ProxyResource - { - /// - /// Initializes a new instance of the BaseUserRule class. - /// - public BaseUserRule() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BaseUserRule 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. - public BaseUserRule(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) - { - SystemData = systemData; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the system metadata related to this resource. - /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHost.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHost.cs index 120d516f0b78..abb537163021 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHost.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHost.cs @@ -46,15 +46,35 @@ public BastionHost() /// 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. /// A unique read-only string that changes whenever /// the resource is updated. - 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), string provisioningState = default(string), string etag = default(string)) + /// 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), 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?), string etag = default(string), Sku sku = default(Sku)) : base(id, name, type, location, tags) { IpConfigurations = ipConfigurations; DnsName = dnsName; ProvisioningState = provisioningState; + ScaleUnits = scaleUnits; + DisableCopyPaste = disableCopyPaste; + EnableFileCopy = enableFileCopy; + EnableIpConnect = enableIpConnect; + EnableShareableLink = enableShareableLink; + EnableTunneling = enableTunneling; Etag = etag; + Sku = sku; CustomInit(); } @@ -83,6 +103,47 @@ public BastionHost() [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } + /// + /// Gets or sets the scale units for the Bastion Host resource. + /// + [JsonProperty(PropertyName = "properties.scaleUnits")] + public int? ScaleUnits { get; set; } + + /// + /// Gets or sets enable/Disable Copy/Paste feature of the Bastion Host + /// resource. + /// + [JsonProperty(PropertyName = "properties.disableCopyPaste")] + public bool? DisableCopyPaste { get; set; } + + /// + /// Gets or sets enable/Disable File Copy feature of the Bastion Host + /// resource. + /// + [JsonProperty(PropertyName = "properties.enableFileCopy")] + public bool? EnableFileCopy { get; set; } + + /// + /// Gets or sets enable/Disable IP Connect feature of the Bastion Host + /// resource. + /// + [JsonProperty(PropertyName = "properties.enableIpConnect")] + public bool? EnableIpConnect { get; set; } + + /// + /// Gets or sets enable/Disable Shareable Link of the Bastion Host + /// resource. + /// + [JsonProperty(PropertyName = "properties.enableShareableLink")] + public bool? EnableShareableLink { get; set; } + + /// + /// Gets or sets enable/Disable Tunneling feature of the Bastion Host + /// resource. + /// + [JsonProperty(PropertyName = "properties.enableTunneling")] + public bool? EnableTunneling { get; set; } + /// /// Gets a unique read-only string that changes whenever the resource /// is updated. @@ -90,5 +151,41 @@ public BastionHost() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } + /// + /// Gets or sets the sku of this Bastion Host. + /// + [JsonProperty(PropertyName = "sku")] + public Sku Sku { 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 (ScaleUnits > 50) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "ScaleUnits", 50); + } + if (ScaleUnits < 2) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ScaleUnits", 2); + } + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteExistingPeering.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHostSkuName.cs similarity index 71% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteExistingPeering.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHostSkuName.cs index c9466027f998..a3dfc0fca92e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteExistingPeering.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BastionHostSkuName.cs @@ -12,11 +12,11 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for DeleteExistingPeering. + /// Defines values for BastionHostSkuName. /// - public static class DeleteExistingPeering + public static class BastionHostSkuName { - public const string False = "False"; - public const string True = "True"; + public const string Basic = "Basic"; + public const string Standard = "Standard"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BgpConnection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BgpConnection.cs index 9afc670cf39e..35fd140862ac 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BgpConnection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BgpConnection.cs @@ -35,6 +35,8 @@ public BgpConnection() /// 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' @@ -45,11 +47,12 @@ public BgpConnection() /// 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), string provisioningState = default(string), string connectionState = default(string), string name = default(string), string etag = default(string), string type = default(string)) + 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) { PeerAsn = peerAsn; PeerIp = peerIp; + HubVirtualNetworkConnection = hubVirtualNetworkConnection; ProvisioningState = provisioningState; ConnectionState = connectionState; Name = name; @@ -75,6 +78,13 @@ public BgpConnection() [JsonProperty(PropertyName = "properties.peerIp")] public string PeerIp { get; set; } + /// + /// Gets or sets the reference to the HubVirtualNetworkConnection + /// resource. + /// + [JsonProperty(PropertyName = "properties.hubVirtualNetworkConnection")] + public SubResource HubVirtualNetworkConnection { get; set; } + /// /// Gets the provisioning state of the resource. Possible values /// include: 'Succeeded', 'Updating', 'Deleting', 'Failed' @@ -116,13 +126,16 @@ public BgpConnection() /// public virtual void Validate() { - if (PeerAsn > 4294967295) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "PeerAsn", 4294967295); - } - if (PeerAsn < 0) + if (PeerAsn != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "PeerAsn", 0); + if (PeerAsn > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "PeerAsn", 4294967295); + } + if (PeerAsn < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "PeerAsn", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BgpPeerStatus.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BgpPeerStatus.cs index 4add761aab2f..843529d85907 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BgpPeerStatus.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BgpPeerStatus.cs @@ -119,13 +119,16 @@ public BgpPeerStatus() /// public virtual void Validate() { - if (Asn > 4294967295) + if (Asn != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Asn", 4294967295); - } - if (Asn < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Asn", 0); + if (Asn > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Asn", 4294967295); + } + if (Asn < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Asn", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BgpSettings.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BgpSettings.cs index 5e5788fc6e23..7ae62bc4e6bb 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BgpSettings.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/BgpSettings.cs @@ -88,13 +88,16 @@ public BgpSettings() /// public virtual void Validate() { - if (Asn > 4294967295) + if (Asn != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Asn", 4294967295); - } - if (Asn < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Asn", 0); + if (Asn > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Asn", 4294967295); + } + if (Asn < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Asn", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationGroup.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationGroup.cs deleted file mode 100644 index a769893b45ec..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationGroup.cs +++ /dev/null @@ -1,111 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The network configuration group resource - /// - [Rest.Serialization.JsonTransformation] - public partial class ConfigurationGroup - { - /// - /// Initializes a new instance of the ConfigurationGroup class. - /// - public ConfigurationGroup() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ConfigurationGroup class. - /// - /// Resource ID. - /// A friendly name for the network - /// group. - /// A description of the network - /// group. - /// Group member type. - /// Group members of network group. - /// Network group conditional - /// filter. - /// The provisioning state of the scope - /// assignment resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - public ConfigurationGroup(string id = default(string), string displayName = default(string), string description = default(string), string memberType = default(string), IList groupMembers = default(IList), string conditionalMembership = default(string), string provisioningState = default(string)) - { - Id = id; - DisplayName = displayName; - Description = description; - MemberType = memberType; - GroupMembers = groupMembers; - ConditionalMembership = conditionalMembership; - ProvisioningState = provisioningState; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets resource ID. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - /// - /// Gets or sets a friendly name for the network group. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets a description of the network group. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets group member type. - /// - [JsonProperty(PropertyName = "properties.memberType")] - public string MemberType { get; set; } - - /// - /// Gets or sets group members of network group. - /// - [JsonProperty(PropertyName = "properties.groupMembers")] - public IList GroupMembers { get; set; } - - /// - /// Gets or sets network group conditional filter. - /// - [JsonProperty(PropertyName = "properties.conditionalMembership")] - public string ConditionalMembership { get; set; } - - /// - /// 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; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitor.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitor.cs index 0caac861305b..89593c0c4910 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitor.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitor.cs @@ -158,13 +158,16 @@ public virtual void Validate() { Destination.Validate(); } - if (MonitoringIntervalInSeconds > 1800) + if (MonitoringIntervalInSeconds != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MonitoringIntervalInSeconds", 1800); - } - if (MonitoringIntervalInSeconds < 30) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MonitoringIntervalInSeconds", 30); + if (MonitoringIntervalInSeconds > 1800) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "MonitoringIntervalInSeconds", 1800); + } + if (MonitoringIntervalInSeconds < 30) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "MonitoringIntervalInSeconds", 30); + } } if (Endpoints != null) { diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorDestination.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorDestination.cs index eb4b187b8726..a2c4c891be63 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorDestination.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorDestination.cs @@ -79,13 +79,16 @@ public ConnectionMonitorDestination() /// public virtual void Validate() { - if (Port > 65535) + if (Port != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 65535); - } - if (Port < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + if (Port > 65535) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 65535); + } + if (Port < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorHttpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorHttpConfiguration.cs index 7d6e8ebc03e8..9f52940d25c4 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorHttpConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorHttpConfiguration.cs @@ -110,13 +110,16 @@ public ConnectionMonitorHttpConfiguration() /// public virtual void Validate() { - if (Port > 65535) + if (Port != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 65535); - } - if (Port < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + if (Port > 65535) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 65535); + } + if (Port < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorParameters.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorParameters.cs index b4ad6eaafdb1..403ef9585674 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorParameters.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorParameters.cs @@ -142,13 +142,16 @@ public virtual void Validate() { Destination.Validate(); } - if (MonitoringIntervalInSeconds > 1800) + if (MonitoringIntervalInSeconds != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MonitoringIntervalInSeconds", 1800); - } - if (MonitoringIntervalInSeconds < 30) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MonitoringIntervalInSeconds", 30); + if (MonitoringIntervalInSeconds > 1800) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "MonitoringIntervalInSeconds", 1800); + } + if (MonitoringIntervalInSeconds < 30) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "MonitoringIntervalInSeconds", 30); + } } if (Endpoints != null) { diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorResult.cs index 2a49a2fa6b6a..afe0533ea4c7 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorResult.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorResult.cs @@ -233,13 +233,16 @@ public virtual void Validate() { Destination.Validate(); } - if (MonitoringIntervalInSeconds > 1800) + if (MonitoringIntervalInSeconds != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MonitoringIntervalInSeconds", 1800); - } - if (MonitoringIntervalInSeconds < 30) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MonitoringIntervalInSeconds", 30); + if (MonitoringIntervalInSeconds > 1800) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "MonitoringIntervalInSeconds", 1800); + } + if (MonitoringIntervalInSeconds < 30) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "MonitoringIntervalInSeconds", 30); + } } if (Endpoints != null) { diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorSource.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorSource.cs index b0627a3e13db..83bd49a53e0d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorSource.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorSource.cs @@ -71,13 +71,16 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "ResourceId"); } - if (Port > 65535) + if (Port != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 65535); - } - if (Port < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + if (Port > 65535) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 65535); + } + if (Port < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorTcpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorTcpConfiguration.cs index 66c4afb87b25..2fe276a1ca7c 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorTcpConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionMonitorTcpConfiguration.cs @@ -78,13 +78,16 @@ public ConnectionMonitorTcpConfiguration() /// public virtual void Validate() { - if (Port > 65535) + if (Port != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 65535); - } - if (Port < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + if (Port > 65535) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 65535); + } + if (Port < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionStateSnapshot.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionStateSnapshot.cs index 30b563b24bd9..fb8bdc77ff24 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionStateSnapshot.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectionStateSnapshot.cs @@ -138,45 +138,60 @@ public ConnectionStateSnapshot() /// public virtual void Validate() { - if (AvgLatencyInMs > 4294967295) + if (AvgLatencyInMs != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "AvgLatencyInMs", 4294967295); + if (AvgLatencyInMs > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "AvgLatencyInMs", 4294967295); + } + if (AvgLatencyInMs < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "AvgLatencyInMs", 0); + } } - if (AvgLatencyInMs < 0) + if (MinLatencyInMs != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "AvgLatencyInMs", 0); + if (MinLatencyInMs > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "MinLatencyInMs", 4294967295); + } + if (MinLatencyInMs < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "MinLatencyInMs", 0); + } } - if (MinLatencyInMs > 4294967295) + if (MaxLatencyInMs != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MinLatencyInMs", 4294967295); + if (MaxLatencyInMs > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxLatencyInMs", 4294967295); + } + if (MaxLatencyInMs < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxLatencyInMs", 0); + } } - if (MinLatencyInMs < 0) + if (ProbesSent != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MinLatencyInMs", 0); + if (ProbesSent > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "ProbesSent", 4294967295); + } + if (ProbesSent < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ProbesSent", 0); + } } - if (MaxLatencyInMs > 4294967295) + if (ProbesFailed != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxLatencyInMs", 4294967295); - } - if (MaxLatencyInMs < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxLatencyInMs", 0); - } - if (ProbesSent > 4294967295) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ProbesSent", 4294967295); - } - if (ProbesSent < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ProbesSent", 0); - } - if (ProbesFailed > 4294967295) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ProbesFailed", 4294967295); - } - if (ProbesFailed < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ProbesFailed", 0); + if (ProbesFailed > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "ProbesFailed", 4294967295); + } + if (ProbesFailed < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ProbesFailed", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityConfiguration.cs deleted file mode 100644 index 2a0075b8e63a..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityConfiguration.cs +++ /dev/null @@ -1,151 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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] - public partial class ConnectivityConfiguration : ProxyResource - { - /// - /// Initializes a new instance of the ConnectivityConfiguration class. - /// - public ConnectivityConfiguration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ConnectivityConfiguration class. - /// - /// Connectivity topology type. - /// Possible values include: 'HubAndSpoke', 'Mesh' - /// Resource ID. - /// Resource name. - /// Resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// A friendly name for the resource. - /// A description of the connectivity - /// configuration. - /// 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' - /// The system metadata related to this - /// resource. - public ConnectivityConfiguration(string connectivityTopology, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string displayName = default(string), string description = default(string), IList hubs = default(IList), string isGlobal = default(string), IList appliesToGroups = default(IList), string provisioningState = default(string), string deleteExistingPeering = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type, etag) - { - DisplayName = displayName; - Description = description; - ConnectivityTopology = connectivityTopology; - Hubs = hubs; - IsGlobal = isGlobal; - AppliesToGroups = appliesToGroups; - ProvisioningState = provisioningState; - DeleteExistingPeering = deleteExistingPeering; - SystemData = systemData; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a friendly name for the resource. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// 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' - /// - [JsonProperty(PropertyName = "properties.connectivityTopology")] - public string ConnectivityTopology { get; set; } - - /// - /// Gets or sets list of hubItems - /// - [JsonProperty(PropertyName = "properties.hubs")] - public IList Hubs { get; set; } - - /// - /// Gets or sets flag if global mesh is supported. Possible values - /// include: 'False', 'True' - /// - [JsonProperty(PropertyName = "properties.isGlobal")] - public string IsGlobal { get; set; } - - /// - /// Gets or sets groups for configuration - /// - [JsonProperty(PropertyName = "properties.appliesToGroups")] - public IList AppliesToGroups { get; set; } - - /// - /// Gets the provisioning state of the connectivity configuration - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets or sets flag if need to remove current existing peerings. - /// Possible values include: 'False', 'True' - /// - [JsonProperty(PropertyName = "properties.deleteExistingPeering")] - public string DeleteExistingPeering { get; set; } - - /// - /// Gets the system metadata related to this resource. - /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ConnectivityTopology == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ConnectivityTopology"); - } - } - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityDestination.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityDestination.cs index 070ecc5f1ead..f6f519013db7 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityDestination.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityDestination.cs @@ -77,13 +77,16 @@ public ConnectivityDestination() /// public virtual void Validate() { - if (Port > 65535) + if (Port != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 65535); - } - if (Port < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + if (Port > 65535) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 65535); + } + if (Port < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityGroupItem.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityGroupItem.cs deleted file mode 100644 index e1f52c22535c..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityGroupItem.cs +++ /dev/null @@ -1,78 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Linq; - - public partial class ConnectivityGroupItem - { - /// - /// Initializes a new instance of the ConnectivityGroupItem class. - /// - public ConnectivityGroupItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ConnectivityGroupItem class. - /// - /// 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' - /// Group connectivity type. Possible - /// values include: 'None', 'DirectlyConnected' - public ConnectivityGroupItem(string networkGroupId = default(string), string useHubGateway = default(string), string isGlobal = default(string), string groupConnectivity = default(string)) - { - NetworkGroupId = networkGroupId; - UseHubGateway = useHubGateway; - IsGlobal = isGlobal; - GroupConnectivity = groupConnectivity; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets network group Id. - /// - [JsonProperty(PropertyName = "networkGroupId")] - public string NetworkGroupId { get; set; } - - /// - /// Gets or sets flag if need to use hub gateway. Possible values - /// include: 'False', 'True' - /// - [JsonProperty(PropertyName = "useHubGateway")] - public string UseHubGateway { get; set; } - - /// - /// Gets or sets flag if global is supported. Possible values include: - /// 'False', 'True' - /// - [JsonProperty(PropertyName = "isGlobal")] - public string IsGlobal { get; set; } - - /// - /// Gets or sets group connectivity type. Possible values include: - /// 'None', 'DirectlyConnected' - /// - [JsonProperty(PropertyName = "groupConnectivity")] - public string GroupConnectivity { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivitySource.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivitySource.cs index 00e6136a7079..9115d726b250 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivitySource.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivitySource.cs @@ -72,13 +72,16 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "ResourceId"); } - if (Port > 65535) + if (Port != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 65535); - } - if (Port < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + if (Port > 65535) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 65535); + } + if (Port < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CustomIpPrefix.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CustomIpPrefix.cs index 4be854e1b5a9..42337c4a1237 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CustomIpPrefix.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CustomIpPrefix.cs @@ -43,6 +43,14 @@ public CustomIpPrefix() /// IP prefix. /// 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', 'Commissioned', 'Decommissioning', @@ -51,6 +59,8 @@ public CustomIpPrefix() /// 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' @@ -58,14 +68,19 @@ public CustomIpPrefix() /// 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 cidr = default(string), string commissionedState = default(string), IList publicIpPrefixes = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string), IList zones = default(IList)) + 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 cidr = default(string), string signedMessage = default(string), string authorizationMessage = default(string), CustomIpPrefix customIpPrefixParent = default(CustomIpPrefix), IList childCustomIpPrefixes = default(IList), string commissionedState = 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) { ExtendedLocation = extendedLocation; Cidr = cidr; + SignedMessage = signedMessage; + AuthorizationMessage = authorizationMessage; + CustomIpPrefixParent = customIpPrefixParent; + ChildCustomIpPrefixes = childCustomIpPrefixes; CommissionedState = commissionedState; PublicIpPrefixes = publicIpPrefixes; ResourceGuid = resourceGuid; + FailedReason = failedReason; ProvisioningState = provisioningState; Etag = etag; Zones = zones; @@ -90,6 +105,30 @@ public CustomIpPrefix() [JsonProperty(PropertyName = "properties.cidr")] public string Cidr { get; set; } + /// + /// Gets or sets signed message for WAN validation. + /// + [JsonProperty(PropertyName = "properties.signedMessage")] + public string SignedMessage { get; set; } + + /// + /// Gets or sets authorization message for WAN validation. + /// + [JsonProperty(PropertyName = "properties.authorizationMessage")] + public string AuthorizationMessage { get; set; } + + /// + /// Gets or sets the Parent CustomIpPrefix for IPv6 /64 CustomIpPrefix. + /// + [JsonProperty(PropertyName = "properties.customIpPrefixParent")] + public CustomIpPrefix CustomIpPrefixParent { get; set; } + + /// + /// Gets the list of all Children for IPv6 /48 CustomIpPrefix. + /// + [JsonProperty(PropertyName = "properties.childCustomIpPrefixes")] + public IList ChildCustomIpPrefixes { get; private set; } + /// /// Gets or sets the commissioned state of the Custom IP Prefix. /// Possible values include: 'Provisioning', 'Provisioned', @@ -111,6 +150,12 @@ public CustomIpPrefix() [JsonProperty(PropertyName = "properties.resourceGuid")] public string ResourceGuid { get; private set; } + /// + /// Gets the reason why resource is in failed state. + /// + [JsonProperty(PropertyName = "properties.failedReason")] + public string FailedReason { get; private set; } + /// /// Gets the provisioning state of the custom IP prefix resource. /// Possible values include: 'Succeeded', 'Updating', 'Deleting', @@ -133,18 +178,5 @@ public CustomIpPrefix() [JsonProperty(PropertyName = "zones")] public IList Zones { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ExtendedLocation != null) - { - ExtendedLocation.Validate(); - } - } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultAdminRule.cs deleted file mode 100644 index 6dc262142654..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultAdminRule.cs +++ /dev/null @@ -1,174 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 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] - public partial class DefaultAdminRule : BaseAdminRule - { - /// - /// Initializes a new instance of the DefaultAdminRule class. - /// - public DefaultAdminRule() - { - CustomInit(); - } - - /// - /// 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 friendly name for the rule. - /// 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' - public DefaultAdminRule(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string displayName = default(string), 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)) - : base(id, name, type, etag, systemData) - { - DisplayName = displayName; - Description = description; - Flag = flag; - Protocol = protocol; - Sources = sources; - Destinations = destinations; - SourcePortRanges = sourcePortRanges; - DestinationPortRanges = destinationPortRanges; - Access = access; - Priority = priority; - Direction = direction; - ProvisioningState = provisioningState; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets a friendly name for the rule. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; private set; } - - /// - /// Gets a description for this rule. Restricted to 140 chars. - /// - [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; } - - /// - /// 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; } - - /// - /// Gets the CIDR or source IP ranges. - /// - [JsonProperty(PropertyName = "properties.sources")] - public IList Sources { get; private set; } - - /// - /// Gets the destination address prefixes. CIDR or destination IP - /// ranges. - /// - [JsonProperty(PropertyName = "properties.destinations")] - public IList Destinations { get; private set; } - - /// - /// Gets the source port ranges. - /// - [JsonProperty(PropertyName = "properties.sourcePortRanges")] - public 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; } - - /// - /// 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; } - - /// - /// 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; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultUserRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultUserRule.cs deleted file mode 100644 index 33e2654c5b61..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DefaultUserRule.cs +++ /dev/null @@ -1,151 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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 default user rule. - /// - [Newtonsoft.Json.JsonObject("Default")] - [Rest.Serialization.JsonTransformation] - public partial class DefaultUserRule : BaseUserRule - { - /// - /// Initializes a new instance of the DefaultUserRule class. - /// - public DefaultUserRule() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DefaultUserRule 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 friendly name for the rule. - /// 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 if the traffic matched against - /// the rule in inbound or outbound. Possible values include: - /// 'Inbound', 'Outbound' - /// The provisioning state of the - /// security configuration user rule resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - public DefaultUserRule(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string displayName = default(string), 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 direction = default(string), string provisioningState = default(string)) - : base(id, name, type, etag, systemData) - { - DisplayName = displayName; - Description = description; - Flag = flag; - Protocol = protocol; - Sources = sources; - Destinations = destinations; - SourcePortRanges = sourcePortRanges; - DestinationPortRanges = destinationPortRanges; - Direction = direction; - ProvisioningState = provisioningState; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets a friendly name for the rule. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; private set; } - - /// - /// Gets a description for this rule. Restricted to 140 chars. - /// - [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; } - - /// - /// 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; } - - /// - /// Gets the CIDR or source IP ranges. - /// - [JsonProperty(PropertyName = "properties.sources")] - public IList Sources { get; private set; } - - /// - /// Gets the destination address prefixes. CIDR or destination IP - /// ranges. - /// - [JsonProperty(PropertyName = "properties.destinations")] - public IList Destinations { get; private set; } - - /// - /// Gets the source port ranges. - /// - [JsonProperty(PropertyName = "properties.sourcePortRanges")] - public IList SourcePortRanges { get; private set; } - - /// - /// Gets the destination port ranges. - /// - [JsonProperty(PropertyName = "properties.destinationPortRanges")] - public IList DestinationPortRanges { get; private set; } - - /// - /// 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 security configuration user rule - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteExistingNSGs.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteExistingNSGs.cs deleted file mode 100644 index 0b31c0657515..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteExistingNSGs.cs +++ /dev/null @@ -1,22 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 DeleteExistingNSGs. - /// - public static class DeleteExistingNSGs - { - public const string False = "False"; - public const string True = "True"; - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UseHubGateway.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteOptions.cs similarity index 72% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UseHubGateway.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteOptions.cs index 6bf6370a4632..79c56e63572b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UseHubGateway.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeleteOptions.cs @@ -12,11 +12,11 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for UseHubGateway. + /// Defines values for DeleteOptions. /// - public static class UseHubGateway + public static class DeleteOptions { - public const string False = "False"; - public const string True = "True"; + public const string Delete = "Delete"; + public const string Detach = "Detach"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeploymentStatus.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeploymentStatus.cs deleted file mode 100644 index 6386ef465c95..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DeploymentStatus.cs +++ /dev/null @@ -1,24 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 DeploymentStatus. - /// - public static class DeploymentStatus - { - public const string NotStarted = "NotStarted"; - public const string Deploying = "Deploying"; - public const string Deployed = "Deployed"; - public const string Failed = "Failed"; - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DscpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DscpConfiguration.cs index 6cec06b0fc21..44da270fbc15 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DscpConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/DscpConfiguration.cs @@ -18,7 +18,8 @@ namespace Microsoft.Azure.Management.Network.Models using System.Linq; /// - /// DSCP Configuration in a resource group. + /// Differentiated Services Code Point configuration for any given network + /// interface /// [Rest.Serialization.JsonTransformation] public partial class DscpConfiguration : Resource @@ -49,6 +50,8 @@ public DscpConfiguration() /// 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 @@ -60,7 +63,7 @@ public DscpConfiguration() /// '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), string qosCollectionId = default(string), IList associatedNetworkInterfaces = default(IList), string resourceGuid = default(string), string provisioningState = default(string), string etag = default(string)) + 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) { Markings = markings; @@ -69,6 +72,7 @@ public DscpConfiguration() SourcePortRanges = sourcePortRanges; DestinationPortRanges = destinationPortRanges; Protocol = protocol; + QosDefinitionCollection = qosDefinitionCollection; QosCollectionId = qosCollectionId; AssociatedNetworkInterfaces = associatedNetworkInterfaces; ResourceGuid = resourceGuid; @@ -120,6 +124,12 @@ public DscpConfiguration() [JsonProperty(PropertyName = "properties.protocol")] public string Protocol { get; set; } + /// + /// Gets or sets qoS object definitions + /// + [JsonProperty(PropertyName = "properties.qosDefinitionCollection")] + public IList QosDefinitionCollection { get; set; } + /// /// Gets qos Collection ID generated by RNM. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveBaseSecurityAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveBaseSecurityAdminRule.cs deleted file mode 100644 index b330b2a67374..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveBaseSecurityAdminRule.cs +++ /dev/null @@ -1,108 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Network base admin rule. - /// - public partial class EffectiveBaseSecurityAdminRule - { - /// - /// Initializes a new instance of the EffectiveBaseSecurityAdminRule - /// class. - /// - public EffectiveBaseSecurityAdminRule() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EffectiveBaseSecurityAdminRule - /// class. - /// - /// Resource ID. - /// A display name of the - /// security admin configuration. - /// A description of the - /// security admin configuration. - /// A display name of the rule - /// collection. - /// A description of the rule - /// collection. - /// Groups for rule - /// collection - /// Effective configuration groups. - public EffectiveBaseSecurityAdminRule(string id = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList)) - { - Id = id; - ConfigurationDisplayName = configurationDisplayName; - ConfigurationDescription = configurationDescription; - RuleCollectionDisplayName = ruleCollectionDisplayName; - RuleCollectionDescription = ruleCollectionDescription; - RuleCollectionAppliesToGroups = ruleCollectionAppliesToGroups; - RuleGroups = ruleGroups; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets resource ID. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - /// - /// Gets or sets a display name of the security admin configuration. - /// - [JsonProperty(PropertyName = "configurationDisplayName")] - public string ConfigurationDisplayName { get; set; } - - /// - /// Gets or sets a description of the security admin configuration. - /// - [JsonProperty(PropertyName = "configurationDescription")] - public string ConfigurationDescription { get; set; } - - /// - /// Gets or sets a display name of the rule collection. - /// - [JsonProperty(PropertyName = "ruleCollectionDisplayName")] - public string RuleCollectionDisplayName { get; set; } - - /// - /// Gets or sets a description of the rule collection. - /// - [JsonProperty(PropertyName = "ruleCollectionDescription")] - public string RuleCollectionDescription { get; set; } - - /// - /// Gets or sets groups for rule collection - /// - [JsonProperty(PropertyName = "ruleCollectionAppliesToGroups")] - public IList RuleCollectionAppliesToGroups { get; set; } - - /// - /// Gets or sets effective configuration groups. - /// - [JsonProperty(PropertyName = "ruleGroups")] - public IList RuleGroups { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveConnectivityConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveConnectivityConfiguration.cs deleted file mode 100644 index 448c37b3af57..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveConnectivityConfiguration.cs +++ /dev/null @@ -1,155 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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] - public partial class EffectiveConnectivityConfiguration - { - /// - /// Initializes a new instance of the - /// EffectiveConnectivityConfiguration class. - /// - public EffectiveConnectivityConfiguration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// EffectiveConnectivityConfiguration class. - /// - /// Connectivity topology type. - /// Possible values include: 'HubAndSpoke', 'Mesh' - /// Resource ID. - /// A friendly name for the resource. - /// A description of the connectivity - /// configuration. - /// 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' - /// Effective configuration - /// groups. - public EffectiveConnectivityConfiguration(string connectivityTopology, string id = default(string), string displayName = default(string), string description = default(string), IList hubs = default(IList), string isGlobal = default(string), IList appliesToGroups = default(IList), string provisioningState = default(string), string deleteExistingPeering = default(string), IList configurationGroups = default(IList)) - { - Id = id; - DisplayName = displayName; - Description = description; - ConnectivityTopology = connectivityTopology; - Hubs = hubs; - IsGlobal = isGlobal; - AppliesToGroups = appliesToGroups; - ProvisioningState = provisioningState; - DeleteExistingPeering = deleteExistingPeering; - ConfigurationGroups = configurationGroups; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets resource ID. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - /// - /// Gets or sets a friendly name for the resource. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// 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' - /// - [JsonProperty(PropertyName = "properties.connectivityTopology")] - public string ConnectivityTopology { get; set; } - - /// - /// Gets or sets list of hubItems - /// - [JsonProperty(PropertyName = "properties.hubs")] - public IList Hubs { get; set; } - - /// - /// Gets or sets flag if global mesh is supported. Possible values - /// include: 'False', 'True' - /// - [JsonProperty(PropertyName = "properties.isGlobal")] - public string IsGlobal { get; set; } - - /// - /// Gets or sets groups for configuration - /// - [JsonProperty(PropertyName = "properties.appliesToGroups")] - public IList AppliesToGroups { get; set; } - - /// - /// Gets the provisioning state of the connectivity configuration - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Gets or sets flag if need to remove current existing peerings. - /// Possible values include: 'False', 'True' - /// - [JsonProperty(PropertyName = "properties.deleteExistingPeering")] - public string DeleteExistingPeering { get; set; } - - /// - /// Gets or sets effective configuration groups. - /// - [JsonProperty(PropertyName = "configurationGroups")] - public IList ConfigurationGroups { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ConnectivityTopology == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ConnectivityTopology"); - } - } - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveDefaultSecurityAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveDefaultSecurityAdminRule.cs deleted file mode 100644 index 15426ac1fac8..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveDefaultSecurityAdminRule.cs +++ /dev/null @@ -1,181 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 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] - public partial class EffectiveDefaultSecurityAdminRule : EffectiveBaseSecurityAdminRule - { - /// - /// Initializes a new instance of the EffectiveDefaultSecurityAdminRule - /// class. - /// - public EffectiveDefaultSecurityAdminRule() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EffectiveDefaultSecurityAdminRule - /// class. - /// - /// Resource ID. - /// A display name of the - /// security admin configuration. - /// A description of the - /// security admin configuration. - /// A display name of the rule - /// collection. - /// A description of the rule - /// collection. - /// Groups for rule - /// collection - /// Effective configuration groups. - /// A friendly name for the rule. - /// 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' - public EffectiveDefaultSecurityAdminRule(string id = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string displayName = default(string), 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)) - : base(id, configurationDisplayName, configurationDescription, ruleCollectionDisplayName, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) - { - DisplayName = displayName; - Description = description; - Flag = flag; - Protocol = protocol; - Sources = sources; - Destinations = destinations; - SourcePortRanges = sourcePortRanges; - DestinationPortRanges = destinationPortRanges; - Access = access; - Priority = priority; - Direction = direction; - ProvisioningState = provisioningState; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets a friendly name for the rule. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; private set; } - - /// - /// Gets a description for this rule. Restricted to 140 chars. - /// - [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; } - - /// - /// 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; } - - /// - /// Gets the CIDR or source IP ranges. - /// - [JsonProperty(PropertyName = "properties.sources")] - public IList Sources { get; private set; } - - /// - /// Gets the destination address prefixes. CIDR or destination IP - /// ranges. - /// - [JsonProperty(PropertyName = "properties.destinations")] - public IList Destinations { get; private set; } - - /// - /// Gets the source port ranges. - /// - [JsonProperty(PropertyName = "properties.sourcePortRanges")] - public 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; } - - /// - /// 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; } - - /// - /// 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; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs index 640f4ea64681..69143cd10cdb 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveNetworkSecurityGroupAssociation.cs @@ -31,11 +31,14 @@ public EffectiveNetworkSecurityGroupAssociation() /// 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. - public EffectiveNetworkSecurityGroupAssociation(SubResource subnet = default(SubResource), SubResource networkInterface = default(SubResource)) + public EffectiveNetworkSecurityGroupAssociation(SubResource networkManager = default(SubResource), SubResource subnet = default(SubResource), SubResource networkInterface = default(SubResource)) { + NetworkManager = networkManager; Subnet = subnet; NetworkInterface = networkInterface; CustomInit(); @@ -46,6 +49,12 @@ 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; } + /// /// Gets or sets the ID of the subnet if assigned. /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveSecurityAdminRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveSecurityAdminRule.cs deleted file mode 100644 index ca3b3fd40591..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveSecurityAdminRule.cs +++ /dev/null @@ -1,201 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 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] - public partial class EffectiveSecurityAdminRule : EffectiveBaseSecurityAdminRule - { - /// - /// Initializes a new instance of the EffectiveSecurityAdminRule class. - /// - public EffectiveSecurityAdminRule() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EffectiveSecurityAdminRule class. - /// - /// 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' - /// Indicates if the traffic matched against - /// the rule in inbound or outbound. Possible values include: - /// 'Inbound', 'Outbound' - /// Resource ID. - /// A display name of the - /// security admin configuration. - /// A description of the - /// security admin configuration. - /// A display name of the rule - /// collection. - /// A description of the rule - /// collection. - /// Groups for rule - /// collection - /// Effective configuration groups. - /// A friendly name for the rule. - /// 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 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. - /// The provisioning state of the - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - public EffectiveSecurityAdminRule(string protocol, string access, string direction, string id = default(string), string configurationDisplayName = default(string), string configurationDescription = default(string), string ruleCollectionDisplayName = default(string), string ruleCollectionDescription = default(string), IList ruleCollectionAppliesToGroups = default(IList), IList ruleGroups = default(IList), string displayName = default(string), string description = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), int? priority = default(int?), string provisioningState = default(string)) - : base(id, configurationDisplayName, configurationDescription, ruleCollectionDisplayName, ruleCollectionDescription, ruleCollectionAppliesToGroups, ruleGroups) - { - DisplayName = displayName; - Description = description; - Protocol = protocol; - Sources = sources; - Destinations = destinations; - SourcePortRanges = sourcePortRanges; - DestinationPortRanges = destinationPortRanges; - Access = access; - Priority = priority; - Direction = direction; - ProvisioningState = provisioningState; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a friendly name for the rule. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// 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', 'Any', 'Ah' - /// - [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; } - - /// - /// Gets or sets the destination address prefixes. CIDR or destination - /// IP ranges. - /// - [JsonProperty(PropertyName = "properties.destinations")] - public IList Destinations { get; set; } - - /// - /// Gets or sets the source port ranges. - /// - [JsonProperty(PropertyName = "properties.sourcePortRanges")] - public IList SourcePortRanges { get; set; } - - /// - /// Gets or sets the destination port ranges. - /// - [JsonProperty(PropertyName = "properties.destinationPortRanges")] - public IList DestinationPortRanges { get; set; } - - /// - /// 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; } - - /// - /// 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; } - - /// - /// 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; } - - /// - /// 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) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 1); - } - } - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetwork.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetwork.cs deleted file mode 100644 index 4712f6cf0c38..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetwork.cs +++ /dev/null @@ -1,69 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Effective Virtual Network - /// - public partial class EffectiveVirtualNetwork - { - /// - /// Initializes a new instance of the EffectiveVirtualNetwork class. - /// - public EffectiveVirtualNetwork() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EffectiveVirtualNetwork class. - /// - /// Effective vnet Id. - /// Location of vnet. - /// Membership Type. Possible values - /// include: 'Static', 'Dynamic' - public EffectiveVirtualNetwork(string id = default(string), string location = default(string), string membershipType = default(string)) - { - Id = id; - Location = location; - MembershipType = membershipType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets effective vnet Id. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } - - /// - /// Gets or sets location of vnet. - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets or sets membership Type. Possible values include: 'Static', - /// 'Dynamic' - /// - [JsonProperty(PropertyName = "membershipType")] - public string MembershipType { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksListResult.cs deleted file mode 100644 index 12d17bf593d2..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksListResult.cs +++ /dev/null @@ -1,68 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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 Effective Virtual Network. It contains a - /// list of groups and a URL link to get the next set of results. - /// - public partial class EffectiveVirtualNetworksListResult - { - /// - /// Initializes a new instance of the - /// EffectiveVirtualNetworksListResult class. - /// - public EffectiveVirtualNetworksListResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// EffectiveVirtualNetworksListResult class. - /// - /// Gets a page of EffectiveVirtualNetwork - /// 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 EffectiveVirtualNetworksListResult(IList value = default(IList), string skipToken = default(string)) - { - Value = value; - SkipToken = skipToken; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets a page of EffectiveVirtualNetwork - /// - [JsonProperty(PropertyName = "value")] - public 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. - /// - [JsonProperty(PropertyName = "skipToken")] - public string SkipToken { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksParameter.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksParameter.cs deleted file mode 100644 index c11954c68d29..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/EffectiveVirtualNetworksParameter.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Effective Virtual Networks Parameter. - /// - public partial class EffectiveVirtualNetworksParameter - { - /// - /// Initializes a new instance of the EffectiveVirtualNetworksParameter - /// class. - /// - public EffectiveVirtualNetworksParameter() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EffectiveVirtualNetworksParameter - /// class. - /// - /// Conditional Members. - /// Continuation token for pagination, - /// capturing the next page size and offset, as well as the context of - /// the query. - public EffectiveVirtualNetworksParameter(string conditionalMembers = default(string), string skipToken = default(string)) - { - ConditionalMembers = conditionalMembers; - SkipToken = skipToken; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets conditional Members. - /// - [JsonProperty(PropertyName = "conditionalMembers")] - public string ConditionalMembers { get; set; } - - /// - /// 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; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExplicitProxySettings.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExplicitProxySettings.cs new file mode 100644 index 000000000000..9435d58b46ce --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExplicitProxySettings.cs @@ -0,0 +1,132 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Network.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Explicit Proxy Settings in Firewall Policy. + /// + public partial class ExplicitProxySettings + { + /// + /// Initializes a new instance of the ExplicitProxySettings class. + /// + public ExplicitProxySettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ExplicitProxySettings 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. + /// Port number for firewall to serve PAC + /// file. + /// SAS URL for PAC file. + public ExplicitProxySettings(bool? enableExplicitProxy = default(bool?), int? httpPort = default(int?), int? httpsPort = default(int?), int? pacFilePort = default(int?), string pacFile = default(string)) + { + EnableExplicitProxy = enableExplicitProxy; + HttpPort = httpPort; + HttpsPort = httpsPort; + PacFilePort = pacFilePort; + PacFile = pacFile; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets when set to true, explicit proxy mode is enabled. + /// + [JsonProperty(PropertyName = "enableExplicitProxy")] + public bool? EnableExplicitProxy { get; set; } + + /// + /// Gets or sets port number for explicit proxy http protocol, cannot + /// be greater than 64000. + /// + [JsonProperty(PropertyName = "httpPort")] + public int? HttpPort { get; set; } + + /// + /// Gets or sets port number for explicit proxy https protocol, cannot + /// be greater than 64000. + /// + [JsonProperty(PropertyName = "httpsPort")] + public int? HttpsPort { get; set; } + + /// + /// Gets or sets port number for firewall to serve PAC file. + /// + [JsonProperty(PropertyName = "pacFilePort")] + public int? PacFilePort { get; set; } + + /// + /// Gets or sets SAS URL for PAC file. + /// + [JsonProperty(PropertyName = "pacFile")] + public string PacFile { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (HttpPort != null) + { + if (HttpPort > 64000) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "HttpPort", 64000); + } + if (HttpPort < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "HttpPort", 0); + } + } + if (HttpsPort != null) + { + if (HttpsPort > 64000) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "HttpsPort", 64000); + } + if (HttpsPort < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "HttpsPort", 0); + } + } + if (PacFilePort != null) + { + if (PacFilePort > 64000) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "PacFilePort", 64000); + } + if (PacFilePort < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "PacFilePort", 0); + } + } + } + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuitPeering.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuitPeering.cs index 207feb5c06e7..5a4692d55c50 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuitPeering.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCircuitPeering.cs @@ -265,13 +265,16 @@ public ExpressRouteCircuitPeering() /// public virtual void Validate() { - if (PeerASN > 4294967295) + if (PeerASN != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "PeerASN", 4294967295); - } - if (PeerASN < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "PeerASN", 1); + if (PeerASN > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "PeerASN", 4294967295); + } + if (PeerASN < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "PeerASN", 1); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCrossConnectionPeering.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCrossConnectionPeering.cs index 7f0342d94b6b..2246452167f1 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCrossConnectionPeering.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExpressRouteCrossConnectionPeering.cs @@ -209,13 +209,16 @@ public ExpressRouteCrossConnectionPeering() /// public virtual void Validate() { - if (PeerASN > 4294967295) + if (PeerASN != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "PeerASN", 4294967295); - } - if (PeerASN < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "PeerASN", 1); + if (PeerASN > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "PeerASN", 4294967295); + } + if (PeerASN < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "PeerASN", 1); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExtendedLocation.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExtendedLocation.cs index 831005217ace..7456d0919b8f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExtendedLocation.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ExtendedLocation.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.Network.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -31,18 +30,14 @@ public ExtendedLocation() /// Initializes a new instance of the ExtendedLocation class. /// /// The name of the extended location. - public ExtendedLocation(string name) + /// The type of the extended location. Possible + /// values include: 'EdgeZone' + public ExtendedLocation(string name = default(string), string type = default(string)) { Name = name; + Type = type; CustomInit(); } - /// - /// Static constructor for ExtendedLocation class. - /// - static ExtendedLocation() - { - Type = "EdgeZone"; - } /// /// An initialization method that performs custom operations like setting defaults @@ -56,23 +51,11 @@ static ExtendedLocation() public string Name { get; set; } /// - /// The type of the extended location. + /// Gets or sets the type of the extended location. Possible values + /// include: 'EdgeZone' /// [JsonProperty(PropertyName = "type")] - public static string Type { get; private set; } + public string Type { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicy.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicy.cs index 981c1ce4f869..ad8cd916585f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicy.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicy.cs @@ -58,7 +58,10 @@ public FirewallPolicy() /// 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 @@ -67,7 +70,7 @@ public FirewallPolicy() /// 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), 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), DnsSettings dnsSettings = default(DnsSettings), FirewallPolicyIntrusionDetection intrusionDetection = default(FirewallPolicyIntrusionDetection), FirewallPolicyTransportSecurity transportSecurity = default(FirewallPolicyTransportSecurity), FirewallPolicySku sku = default(FirewallPolicySku), string etag = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity)) + public FirewallPolicy(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), 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), ExplicitProxySettings explicitProxySettings = default(ExplicitProxySettings), 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) { RuleCollectionGroups = ruleCollectionGroups; @@ -79,7 +82,9 @@ public FirewallPolicy() ThreatIntelWhitelist = threatIntelWhitelist; Insights = insights; Snat = snat; + Sql = sql; DnsSettings = dnsSettings; + ExplicitProxySettings = explicitProxySettings; IntrusionDetection = intrusionDetection; TransportSecurity = transportSecurity; Sku = sku; @@ -153,12 +158,24 @@ public FirewallPolicy() [JsonProperty(PropertyName = "properties.snat")] public FirewallPolicySNAT Snat { get; set; } + /// + /// Gets or sets SQL Settings definition. + /// + [JsonProperty(PropertyName = "properties.sql")] + public FirewallPolicySQL Sql { get; set; } + /// /// Gets or sets DNS Proxy Settings definition. /// [JsonProperty(PropertyName = "properties.dnsSettings")] public DnsSettings DnsSettings { get; set; } + /// + /// Gets or sets explicit Proxy Settings definition. + /// + [JsonProperty(PropertyName = "properties.explicitProxySettings")] + public ExplicitProxySettings ExplicitProxySettings { get; set; } + /// /// Gets or sets the configuration for Intrusion detection. /// @@ -190,5 +207,18 @@ public FirewallPolicy() [JsonProperty(PropertyName = "identity")] public ManagedServiceIdentity Identity { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ExplicitProxySettings != null) + { + ExplicitProxySettings.Validate(); + } + } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyFilterRuleCollection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyFilterRuleCollection.cs index f0a93af05634..2184add4699b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyFilterRuleCollection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyFilterRuleCollection.cs @@ -18,6 +18,7 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Firewall Policy Filter Rule Collection. /// + [Newtonsoft.Json.JsonObject("FirewallPolicyFilterRuleCollection")] public partial class FirewallPolicyFilterRuleCollection : FirewallPolicyRuleCollection { /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyNatRuleCollection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyNatRuleCollection.cs index 45fc27690fbb..5466fda21bf3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyNatRuleCollection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyNatRuleCollection.cs @@ -18,6 +18,7 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Firewall Policy NAT Rule Collection. /// + [Newtonsoft.Json.JsonObject("FirewallPolicyNatRuleCollection")] public partial class FirewallPolicyNatRuleCollection : FirewallPolicyRuleCollection { /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyRule.cs index f56257124f71..ed4b7f977df1 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyRule.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyRule.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Properties of a rule. /// + [Newtonsoft.Json.JsonObject("FirewallPolicyRule")] public partial class FirewallPolicyRule { /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyRuleApplicationProtocol.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyRuleApplicationProtocol.cs index cf68f4aa6b54..2bad4a0ff8cf 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyRuleApplicationProtocol.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyRuleApplicationProtocol.cs @@ -70,13 +70,16 @@ public FirewallPolicyRuleApplicationProtocol() /// public virtual void Validate() { - if (Port > 64000) + if (Port != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 64000); - } - if (Port < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + if (Port > 64000) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Port", 64000); + } + if (Port < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Port", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyRuleCollection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyRuleCollection.cs index 03123f19d0fa..824b73fb84a3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyRuleCollection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyRuleCollection.cs @@ -17,6 +17,7 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Properties of the rule collection. /// + [Newtonsoft.Json.JsonObject("FirewallPolicyRuleCollection")] public partial class FirewallPolicyRuleCollection { /// @@ -68,13 +69,16 @@ public FirewallPolicyRuleCollection() /// public virtual void Validate() { - if (Priority > 65000) + if (Priority != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 65000); - } - if (Priority < 100) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 100); + if (Priority > 65000) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 65000); + } + if (Priority < 100) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 100); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyRuleCollectionGroup.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyRuleCollectionGroup.cs index b417d38a1e8c..3cd122ca0f1d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyRuleCollectionGroup.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyRuleCollectionGroup.cs @@ -116,13 +116,16 @@ public FirewallPolicyRuleCollectionGroup() /// public virtual void Validate() { - if (Priority > 65000) + if (Priority != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 65000); - } - if (Priority < 100) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 100); + if (Priority > 65000) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Priority", 65000); + } + if (Priority < 100) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Priority", 100); + } } if (RuleCollections != null) { diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Hub.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicySQL.cs similarity index 51% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Hub.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicySQL.cs index a086b9d5dd9a..2e5943a839a9 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Hub.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicySQL.cs @@ -14,27 +14,27 @@ namespace Microsoft.Azure.Management.Network.Models using System.Linq; /// - /// Hub Item. + /// SQL Settings in Firewall Policy. /// - public partial class Hub + public partial class FirewallPolicySQL { /// - /// Initializes a new instance of the Hub class. + /// Initializes a new instance of the FirewallPolicySQL class. /// - public Hub() + public FirewallPolicySQL() { CustomInit(); } /// - /// Initializes a new instance of the Hub class. + /// Initializes a new instance of the FirewallPolicySQL class. /// - /// Resource Id. - /// Resource Type. - public Hub(string resourceId = default(string), string resourceType = default(string)) + /// 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?)) { - ResourceId = resourceId; - ResourceType = resourceType; + AllowSqlRedirect = allowSqlRedirect; CustomInit(); } @@ -44,16 +44,12 @@ public Hub() partial void CustomInit(); /// - /// Gets or sets resource Id. + /// 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 = "resourceId")] - public string ResourceId { get; set; } - - /// - /// Gets or sets resource Type. - /// - [JsonProperty(PropertyName = "resourceType")] - public string ResourceType { get; set; } + [JsonProperty(PropertyName = "allowSqlRedirect")] + public bool? AllowSqlRedirect { get; set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIpConfiguration.cs index e3b82f118118..ad66fc03d071 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIpConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FrontendIpConfiguration.cs @@ -55,6 +55,8 @@ public FrontendIPConfiguration() /// 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' @@ -66,7 +68,7 @@ public FrontendIPConfiguration() /// 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), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string), IList zones = default(IList)) + 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) { InboundNatRules = inboundNatRules; @@ -79,6 +81,7 @@ public FrontendIPConfiguration() Subnet = subnet; PublicIPAddress = publicIPAddress; PublicIPPrefix = publicIPPrefix; + GatewayLoadBalancer = gatewayLoadBalancer; ProvisioningState = provisioningState; Name = name; Etag = etag; @@ -158,6 +161,12 @@ public FrontendIPConfiguration() [JsonProperty(PropertyName = "properties.publicIPPrefix")] public SubResource PublicIPPrefix { get; set; } + /// + /// Gets or sets the reference to gateway load balancer frontend IP. + /// + [JsonProperty(PropertyName = "properties.gatewayLoadBalancer")] + public SubResource GatewayLoadBalancer { get; set; } + /// /// Gets the provisioning state of the frontend IP configuration /// resource. Possible values include: 'Succeeded', 'Updating', @@ -194,18 +203,5 @@ public FrontendIPConfiguration() [JsonProperty(PropertyName = "zones")] public IList Zones { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (PublicIPAddress != null) - { - PublicIPAddress.Validate(); - } - } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelInterface.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelInterface.cs new file mode 100644 index 000000000000..e074a3f6dfce --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelInterface.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 Newtonsoft.Json; + using System.Linq; + + /// + /// Gateway load balancer tunnel interface of a load balancer backend + /// address pool. + /// + public partial class GatewayLoadBalancerTunnelInterface + { + /// + /// Initializes a new instance of the + /// GatewayLoadBalancerTunnelInterface class. + /// + public GatewayLoadBalancerTunnelInterface() + { + CustomInit(); + } + + /// + /// 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' + 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; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets port of gateway load balancer tunnel interface. + /// + [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; } + + /// + /// Gets or sets protocol of gateway load balancer tunnel interface. + /// Possible values include: 'None', 'Native', 'VXLAN' + /// + [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' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationType.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelInterfaceType.cs similarity index 62% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationType.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelInterfaceType.cs index b98b4fb4e3a4..849a8b8eeb01 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConfigurationType.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelInterfaceType.cs @@ -12,12 +12,12 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for ConfigurationType. + /// Defines values for GatewayLoadBalancerTunnelInterfaceType. /// - public static class ConfigurationType + public static class GatewayLoadBalancerTunnelInterfaceType { - public const string SecurityAdmin = "SecurityAdmin"; - public const string SecurityUser = "SecurityUser"; - public const string Connectivity = "Connectivity"; + public const string None = "None"; + public const string Internal = "Internal"; + public const string External = "External"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GroupConnectivity.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelProtocol.cs similarity index 70% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GroupConnectivity.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelProtocol.cs index 1887920ed507..a4972933b927 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GroupConnectivity.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GatewayLoadBalancerTunnelProtocol.cs @@ -12,11 +12,12 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for GroupConnectivity. + /// Defines values for GatewayLoadBalancerTunnelProtocol. /// - public static class GroupConnectivity + public static class GatewayLoadBalancerTunnelProtocol { public const string None = "None"; - public const string DirectlyConnected = "DirectlyConnected"; + public const string Native = "Native"; + public const string VXLAN = "VXLAN"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/HopLink.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/HopLink.cs index 64218016af56..cfec5a05915c 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/HopLink.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/HopLink.cs @@ -119,29 +119,38 @@ public HopLink() /// public virtual void Validate() { - if (RoundTripTimeMin > 4294967295) + if (RoundTripTimeMin != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "RoundTripTimeMin", 4294967295); + if (RoundTripTimeMin > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "RoundTripTimeMin", 4294967295); + } + if (RoundTripTimeMin < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "RoundTripTimeMin", 0); + } } - if (RoundTripTimeMin < 0) + if (RoundTripTimeAvg != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "RoundTripTimeMin", 0); + if (RoundTripTimeAvg > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "RoundTripTimeAvg", 4294967295); + } + if (RoundTripTimeAvg < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "RoundTripTimeAvg", 0); + } } - if (RoundTripTimeAvg > 4294967295) + if (RoundTripTimeMax != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "RoundTripTimeAvg", 4294967295); - } - if (RoundTripTimeAvg < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "RoundTripTimeAvg", 0); - } - if (RoundTripTimeMax > 4294967295) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "RoundTripTimeMax", 4294967295); - } - if (RoundTripTimeMax < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "RoundTripTimeMax", 0); + if (RoundTripTimeMax > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "RoundTripTimeMax", 4294967295); + } + if (RoundTripTimeMax < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "RoundTripTimeMax", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/HubIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/HubIpConfiguration.cs index 6c4362bf084d..fd8a90ac97a1 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/HubIpConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/HubIpConfiguration.cs @@ -119,18 +119,5 @@ public HubIpConfiguration() [JsonProperty(PropertyName = "type")] public string Type { get; private set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (PublicIPAddress != null) - { - PublicIPAddress.Validate(); - } - } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPConfiguration.cs index 5bca8e8b4870..7141647772af 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IPConfiguration.cs @@ -114,18 +114,5 @@ public IPConfiguration() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (PublicIPAddress != null) - { - PublicIPAddress.Validate(); - } - } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/InboundNatRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/InboundNatRule.cs index 7efd2ff41914..0b3e1fd64a2c 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/InboundNatRule.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/InboundNatRule.cs @@ -59,6 +59,20 @@ public InboundNatRule() /// 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' @@ -68,7 +82,7 @@ public InboundNatRule() /// 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?), string provisioningState = default(string), string name = default(string), string etag = default(string), string type = default(string)) + 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) { FrontendIPConfiguration = frontendIPConfiguration; @@ -79,6 +93,9 @@ public InboundNatRule() IdleTimeoutInMinutes = idleTimeoutInMinutes; EnableFloatingIP = enableFloatingIP; EnableTcpReset = enableTcpReset; + FrontendPortRangeStart = frontendPortRangeStart; + FrontendPortRangeEnd = frontendPortRangeEnd; + BackendAddressPool = backendAddressPool; ProvisioningState = provisioningState; Name = name; Etag = etag; @@ -153,6 +170,32 @@ public InboundNatRule() [JsonProperty(PropertyName = "properties.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. + /// + [JsonProperty(PropertyName = "properties.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. + /// + [JsonProperty(PropertyName = "properties.frontendPortRangeEnd")] + public int? FrontendPortRangeEnd { get; set; } + + /// + /// Gets or sets a reference to backendAddressPool resource. + /// + [JsonProperty(PropertyName = "properties.backendAddressPool")] + public SubResource BackendAddressPool { get; set; } + /// /// Gets the provisioning state of the inbound NAT rule resource. /// Possible values include: 'Succeeded', 'Updating', 'Deleting', @@ -182,18 +225,5 @@ public InboundNatRule() [JsonProperty(PropertyName = "type")] public string Type { get; private set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (BackendIPConfiguration != null) - { - BackendIPConfiguration.Validate(); - } - } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/InboundSecurityRules.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/InboundSecurityRules.cs index be9f44b217ff..133d8fe7975e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/InboundSecurityRules.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/InboundSecurityRules.cs @@ -78,13 +78,16 @@ public InboundSecurityRules() /// public virtual void Validate() { - if (DestinationPortRange > 65535) + if (DestinationPortRange != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "DestinationPortRange", 65535); - } - if (DestinationPortRange < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "DestinationPortRange", 0); + if (DestinationPortRange > 65535) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "DestinationPortRange", 65535); + } + if (DestinationPortRange < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "DestinationPortRange", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancer.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancer.cs index 7db69cc00db7..17b7fe0ef374 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancer.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancer.cs @@ -190,78 +190,5 @@ public LoadBalancer() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ExtendedLocation != null) - { - ExtendedLocation.Validate(); - } - if (FrontendIPConfigurations != null) - { - foreach (var element in FrontendIPConfigurations) - { - if (element != null) - { - element.Validate(); - } - } - } - if (LoadBalancingRules != null) - { - foreach (var element1 in LoadBalancingRules) - { - if (element1 != null) - { - element1.Validate(); - } - } - } - if (Probes != null) - { - foreach (var element2 in Probes) - { - if (element2 != null) - { - element2.Validate(); - } - } - } - if (InboundNatRules != null) - { - foreach (var element3 in InboundNatRules) - { - if (element3 != null) - { - element3.Validate(); - } - } - } - if (InboundNatPools != null) - { - foreach (var element4 in InboundNatPools) - { - if (element4 != null) - { - element4.Validate(); - } - } - } - if (OutboundRules != null) - { - foreach (var element5 in OutboundRules) - { - if (element5 != null) - { - element5.Validate(); - } - } - } - } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSku.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSku.cs index b7daccca169d..17e411b38951 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSku.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSku.cs @@ -30,7 +30,7 @@ public LoadBalancerSku() /// Initializes a new instance of the LoadBalancerSku class. /// /// Name of a load balancer SKU. Possible values - /// include: 'Basic', 'Standard' + /// 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)) @@ -47,7 +47,7 @@ public LoadBalancerSku() /// /// Gets or sets name of a load balancer SKU. Possible values include: - /// 'Basic', 'Standard' + /// 'Basic', 'Standard', 'Gateway' /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSkuName.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSkuName.cs index 47d143e327b1..bad640c6edd2 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSkuName.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerSkuName.cs @@ -18,5 +18,6 @@ public static class LoadBalancerSkuName { public const string Basic = "Basic"; public const string Standard = "Standard"; + public const string Gateway = "Gateway"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequest.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequest.cs new file mode 100644 index 000000000000..fd58d9f58f70 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequest.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The request for a VIP swap. + /// + public partial class LoadBalancerVipSwapRequest + { + /// + /// Initializes a new instance of the LoadBalancerVipSwapRequest class. + /// + public LoadBalancerVipSwapRequest() + { + CustomInit(); + } + + /// + /// 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)) + { + FrontendIPConfigurations = frontendIPConfigurations; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a list of frontend IP configuration resources that + /// should swap VIPs. + /// + [JsonProperty(PropertyName = "frontendIPConfigurations")] + public IList FrontendIPConfigurations { get; set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequestFrontendIPConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequestFrontendIPConfiguration.cs new file mode 100644 index 000000000000..becef2a1e7ed --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancerVipSwapRequestFrontendIPConfiguration.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// VIP swap request's frontend IP configuration object. + /// + [Rest.Serialization.JsonTransformation] + public partial class LoadBalancerVipSwapRequestFrontendIPConfiguration + { + /// + /// Initializes a new instance of the + /// LoadBalancerVipSwapRequestFrontendIPConfiguration class. + /// + public LoadBalancerVipSwapRequestFrontendIPConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// LoadBalancerVipSwapRequestFrontendIPConfiguration class. + /// + /// 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; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the ID of frontend IP configuration resource. + /// + [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; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancingRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancingRule.cs index ba4e7129fca1..109185a6cc7e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancingRule.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/LoadBalancingRule.cs @@ -13,6 +13,8 @@ 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; /// @@ -45,6 +47,8 @@ public LoadBalancingRule() /// 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 @@ -77,11 +81,12 @@ public LoadBalancingRule() /// 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), 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)) + 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) { FrontendIPConfiguration = frontendIPConfiguration; BackendAddressPool = backendAddressPool; + BackendAddressPools = backendAddressPools; Probe = probe; Protocol = protocol; LoadDistribution = loadDistribution; @@ -116,6 +121,12 @@ public LoadBalancingRule() [JsonProperty(PropertyName = "properties.backendAddressPool")] public SubResource BackendAddressPool { get; set; } + /// + /// Gets or sets an array of references to pool of DIPs. + /// + [JsonProperty(PropertyName = "properties.backendAddressPools")] + public IList BackendAddressPools { get; set; } + /// /// Gets or sets the reference to the load balancer probe used by the /// load balancing rule. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MembershipType.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MembershipType.cs deleted file mode 100644 index 4b0ba6401381..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/MembershipType.cs +++ /dev/null @@ -1,22 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 MembershipType. - /// - public static class MembershipType - { - public const string Static = "Static"; - public const string Dynamic = "Dynamic"; - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NatRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NatRule.cs index 8fa86e0c9935..8dbc9d3c938e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NatRule.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NatRule.cs @@ -18,6 +18,7 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Rule of type nat. /// + [Newtonsoft.Json.JsonObject("NatRule")] public partial class NatRule : FirewallPolicyRule { /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroup.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroup.cs deleted file mode 100644 index 954e1fb23a80..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroup.cs +++ /dev/null @@ -1,118 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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 group resource - /// - [Rest.Serialization.JsonTransformation] - public partial class NetworkGroup : ProxyResource - { - /// - /// Initializes a new instance of the NetworkGroup class. - /// - public NetworkGroup() - { - CustomInit(); - } - - /// - /// 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 friendly name for the network - /// group. - /// A description of the network - /// group. - /// Group member type. - /// Group members of network group. - /// Network group conditional - /// filter. - /// The provisioning state of the scope - /// assignment resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// 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 displayName = default(string), string description = default(string), string memberType = default(string), IList groupMembers = default(IList), string conditionalMembership = default(string), string provisioningState = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type, etag) - { - DisplayName = displayName; - Description = description; - MemberType = memberType; - GroupMembers = groupMembers; - ConditionalMembership = conditionalMembership; - ProvisioningState = provisioningState; - SystemData = systemData; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a friendly name for the network group. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets a description of the network group. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets group member type. - /// - [JsonProperty(PropertyName = "properties.memberType")] - public string MemberType { get; set; } - - /// - /// Gets or sets group members of network group. - /// - [JsonProperty(PropertyName = "properties.groupMembers")] - public IList GroupMembers { get; set; } - - /// - /// Gets or sets network group conditional filter. - /// - [JsonProperty(PropertyName = "properties.conditionalMembership")] - public string ConditionalMembership { get; set; } - - /// - /// 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; } - - /// - /// Gets the system metadata related to this resource. - /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroupsCreateOrUpdateHeaders.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroupsCreateOrUpdateHeaders.cs deleted file mode 100644 index dde367cf19ed..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkGroupsCreateOrUpdateHeaders.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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. - /// - public NetworkGroupsCreateOrUpdateHeaders() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// NetworkGroupsCreateOrUpdateHeaders class. - /// - /// The current entity tag. - public NetworkGroupsCreateOrUpdateHeaders(string eTag = default(string)) - { - ETag = eTag; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the current entity tag. - /// - [JsonProperty(PropertyName = "ETag")] - public string ETag { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterface.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterface.cs index 9bedac0024b0..e9a8ebc700fb 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterface.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterface.cs @@ -70,6 +70,8 @@ public NetworkInterface() /// 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 @@ -79,7 +81,7 @@ public NetworkInterface() /// 'Abort', 'Committed' /// 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? enableAcceleratedNetworking = default(bool?), bool? enableIPForwarding = default(bool?), IList hostedWorkloads = default(IList), SubResource dscpConfiguration = default(SubResource), string resourceGuid = default(string), string provisioningState = default(string), string nicType = default(string), PrivateLinkService privateLinkService = default(PrivateLinkService), string migrationPhase = default(string), string etag = default(string)) + 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? enableAcceleratedNetworking = 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 etag = default(string)) : base(id, name, type, location, tags) { ExtendedLocation = extendedLocation; @@ -97,6 +99,7 @@ public NetworkInterface() DscpConfiguration = dscpConfiguration; ResourceGuid = resourceGuid; ProvisioningState = provisioningState; + WorkloadType = workloadType; NicType = nicType; PrivateLinkService = privateLinkService; MigrationPhase = migrationPhase; @@ -206,6 +209,13 @@ public NetworkInterface() [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } + /// + /// Gets or sets workloadType of the NetworkInterface for BareMetal + /// resources + /// + [JsonProperty(PropertyName = "properties.workloadType")] + public string WorkloadType { get; set; } + /// /// Gets or sets type of Network Interface resource. Possible values /// include: 'Standard', 'Elastic' @@ -234,46 +244,5 @@ public NetworkInterface() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ExtendedLocation != null) - { - ExtendedLocation.Validate(); - } - if (PrivateEndpoint != null) - { - PrivateEndpoint.Validate(); - } - if (IpConfigurations != null) - { - foreach (var element in IpConfigurations) - { - if (element != null) - { - element.Validate(); - } - } - } - if (TapConfigurations != null) - { - foreach (var element1 in TapConfigurations) - { - if (element1 != null) - { - element1.Validate(); - } - } - } - if (PrivateLinkService != null) - { - PrivateLinkService.Validate(); - } - } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIpConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIpConfiguration.cs index 89f950d3af69..80fbd5539228 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIpConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceIpConfiguration.cs @@ -37,6 +37,8 @@ public NetworkInterfaceIPConfiguration() /// class. /// /// Resource ID. + /// The reference to gateway load + /// balancer frontend IP. /// The reference to Virtual Network /// Taps. /// The reference @@ -71,9 +73,10 @@ public NetworkInterfaceIPConfiguration() /// A unique read-only string that changes whenever /// the resource is updated. /// Resource type. - public NetworkInterfaceIPConfiguration(string id = default(string), 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)) + 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) { + GatewayLoadBalancer = gatewayLoadBalancer; VirtualNetworkTaps = virtualNetworkTaps; ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; LoadBalancerBackendAddressPools = loadBalancerBackendAddressPools; @@ -98,6 +101,12 @@ public NetworkInterfaceIPConfiguration() /// partial void CustomInit(); + /// + /// Gets or sets the reference to gateway load balancer frontend IP. + /// + [JsonProperty(PropertyName = "properties.gatewayLoadBalancer")] + public SubResource GatewayLoadBalancer { get; set; } + /// /// Gets or sets the reference to Virtual Network Taps. /// @@ -204,38 +213,5 @@ public NetworkInterfaceIPConfiguration() [JsonProperty(PropertyName = "type")] public string Type { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (VirtualNetworkTaps != null) - { - foreach (var element in VirtualNetworkTaps) - { - if (element != null) - { - element.Validate(); - } - } - } - if (LoadBalancerInboundNatRules != null) - { - foreach (var element1 in LoadBalancerInboundNatRules) - { - if (element1 != null) - { - element1.Validate(); - } - } - } - if (PublicIPAddress != null) - { - PublicIPAddress.Validate(); - } - } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceTapConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceTapConfiguration.cs index 2b922b608c31..7be020d7ccf3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceTapConfiguration.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkInterfaceTapConfiguration.cs @@ -96,18 +96,5 @@ public NetworkInterfaceTapConfiguration() [JsonProperty(PropertyName = "type")] public string Type { get; private set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (VirtualNetworkTap != null) - { - VirtualNetworkTap.Validate(); - } - } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManager.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManager.cs deleted file mode 100644 index 4e4ac7a275b5..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManager.cs +++ /dev/null @@ -1,120 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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] - public partial class NetworkManager : Resource - { - /// - /// Initializes a new instance of the NetworkManager class. - /// - public NetworkManager() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the NetworkManager class. - /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// A friendly name for the network - /// manager. - /// A description of the network - /// manager. - /// Scope of Network - /// Manager. - /// Scope Access. - /// The provisioning state of the scope - /// assignment resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// A unique read-only string that changes whenever - /// the resource is updated. - /// The system metadata related to this - /// resource. - public NetworkManager(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string displayName = default(string), string description = default(string), NetworkManagerPropertiesNetworkManagerScopes networkManagerScopes = default(NetworkManagerPropertiesNetworkManagerScopes), IList networkManagerScopeAccesses = default(IList), string provisioningState = default(string), string etag = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type, location, tags) - { - DisplayName = displayName; - Description = description; - NetworkManagerScopes = networkManagerScopes; - NetworkManagerScopeAccesses = networkManagerScopeAccesses; - ProvisioningState = provisioningState; - Etag = etag; - SystemData = systemData; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a friendly name for the network manager. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// 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. - /// - [JsonProperty(PropertyName = "properties.networkManagerScopes")] - public NetworkManagerPropertiesNetworkManagerScopes NetworkManagerScopes { get; set; } - - /// - /// Gets or sets scope Access. - /// - [JsonProperty(PropertyName = "properties.networkManagerScopeAccesses")] - public IList NetworkManagerScopeAccesses { get; set; } - - /// - /// 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; } - - /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - - /// - /// Gets the system metadata related to this resource. - /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerCommit.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerCommit.cs deleted file mode 100644 index 29bacf96030c..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerCommit.cs +++ /dev/null @@ -1,79 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Network Manager Commit. - /// - public partial class NetworkManagerCommit - { - /// - /// Initializes a new instance of the NetworkManagerCommit class. - /// - public NetworkManagerCommit() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the NetworkManagerCommit class. - /// - /// Commit Id. - /// List of target locations. - /// List of configuration ids. - /// Commit Type. Possible values include: - /// 'SecurityAdmin', 'SecurityUser', 'Connectivity' - public NetworkManagerCommit(string commitId = default(string), IList targetLocations = default(IList), IList configurationIds = default(IList), string commitType = default(string)) - { - CommitId = commitId; - TargetLocations = targetLocations; - ConfigurationIds = configurationIds; - CommitType = commitType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets commit Id. - /// - [JsonProperty(PropertyName = "commitId")] - public string CommitId { get; private set; } - - /// - /// Gets or sets list of target locations. - /// - [JsonProperty(PropertyName = "targetLocations")] - public IList TargetLocations { get; set; } - - /// - /// Gets or sets list of configuration ids. - /// - [JsonProperty(PropertyName = "configurationIds")] - public IList ConfigurationIds { get; set; } - - /// - /// Gets or sets commit Type. Possible values include: 'SecurityAdmin', - /// 'SecurityUser', 'Connectivity' - /// - [JsonProperty(PropertyName = "commitType")] - public string CommitType { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatus.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatus.cs deleted file mode 100644 index 3889883d399b..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatus.cs +++ /dev/null @@ -1,99 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Network Manager Deployment Status. - /// - public partial class NetworkManagerDeploymentStatus - { - /// - /// Initializes a new instance of the NetworkManagerDeploymentStatus - /// class. - /// - public NetworkManagerDeploymentStatus() - { - CustomInit(); - } - - /// - /// 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', 'SecurityUser', '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)) - { - CommitTime = commitTime; - Region = region; - DeploymentStatus = deploymentStatus; - ConfigurationIds = configurationIds; - DeploymentType = deploymentType; - ErrorMessage = errorMessage; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets commit Time. - /// - [JsonProperty(PropertyName = "commitTime")] - public System.DateTime? CommitTime { get; set; } - - /// - /// Gets or sets region Name. - /// - [JsonProperty(PropertyName = "region")] - public string Region { get; set; } - - /// - /// Gets or sets deployment Status. Possible values include: - /// 'NotStarted', 'Deploying', 'Deployed', 'Failed' - /// - [JsonProperty(PropertyName = "deploymentStatus")] - public string DeploymentStatus { get; set; } - - /// - /// Gets or sets list of configuration ids. - /// - [JsonProperty(PropertyName = "configurationIds")] - public IList ConfigurationIds { get; set; } - - /// - /// Gets or sets possible values include: 'SecurityAdmin', - /// 'SecurityUser', 'Connectivity' - /// - [JsonProperty(PropertyName = "deploymentType")] - public string DeploymentType { get; set; } - - /// - /// Gets or sets error Message. - /// - [JsonProperty(PropertyName = "errorMessage")] - public string ErrorMessage { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusListResult.cs deleted file mode 100644 index 383a5dda10df..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusListResult.cs +++ /dev/null @@ -1,68 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A list of Network Manager Deployment Status - /// - public partial class NetworkManagerDeploymentStatusListResult - { - /// - /// Initializes a new instance of the - /// NetworkManagerDeploymentStatusListResult class. - /// - public NetworkManagerDeploymentStatusListResult() - { - CustomInit(); - } - - /// - /// 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)) - { - Value = value; - SkipToken = skipToken; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets a page of Network Manager Deployment Status - /// - [JsonProperty(PropertyName = "value")] - public 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. - /// - [JsonProperty(PropertyName = "skipToken")] - public string SkipToken { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusParameter.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusParameter.cs deleted file mode 100644 index 5f72882b1163..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerDeploymentStatusParameter.cs +++ /dev/null @@ -1,74 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Network Manager Deployment Status Parameter. - /// - public partial class NetworkManagerDeploymentStatusParameter - { - /// - /// Initializes a new instance of the - /// NetworkManagerDeploymentStatusParameter class. - /// - public NetworkManagerDeploymentStatusParameter() - { - CustomInit(); - } - - /// - /// 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)) - { - Regions = regions; - DeploymentTypes = deploymentTypes; - SkipToken = skipToken; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets list of locations. - /// - [JsonProperty(PropertyName = "regions")] - public IList Regions { get; set; } - - /// - /// Gets or sets list of deployment types. - /// - [JsonProperty(PropertyName = "deploymentTypes")] - public 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. - /// - [JsonProperty(PropertyName = "skipToken")] - public string SkipToken { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveConnectivityConfigurationListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveConnectivityConfigurationListResult.cs deleted file mode 100644 index 3450d169eb10..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveConnectivityConfigurationListResult.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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 - /// networkManagerEffectiveConnectivityConfiguration. It contains a list of - /// groups and a skiptoken to get the next set of results. - /// - public partial class NetworkManagerEffectiveConnectivityConfigurationListResult - { - /// - /// Initializes a new instance of the - /// NetworkManagerEffectiveConnectivityConfigurationListResult class. - /// - public NetworkManagerEffectiveConnectivityConfigurationListResult() - { - CustomInit(); - } - - /// - /// 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)) - { - Value = value; - SkipToken = skipToken; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets a page of NetworkManagerEffectiveConnectivityConfiguration - /// - [JsonProperty(PropertyName = "value")] - public 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. - /// - [JsonProperty(PropertyName = "skipToken")] - public string SkipToken { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveSecurityAdminRulesListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveSecurityAdminRulesListResult.cs deleted file mode 100644 index aa26d6280c37..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerEffectiveSecurityAdminRulesListResult.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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. - /// - public partial class NetworkManagerEffectiveSecurityAdminRulesListResult - { - /// - /// Initializes a new instance of the - /// NetworkManagerEffectiveSecurityAdminRulesListResult class. - /// - public NetworkManagerEffectiveSecurityAdminRulesListResult() - { - CustomInit(); - } - - /// - /// 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)) - { - Value = value; - SkipToken = skipToken; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets a page of NetworkManagerEffectiveSecurityAdminRules - /// - [JsonProperty(PropertyName = "value")] - public 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. - /// - [JsonProperty(PropertyName = "skipToken")] - public string SkipToken { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerPropertiesNetworkManagerScopes.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerPropertiesNetworkManagerScopes.cs deleted file mode 100644 index 0812942d9e55..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerPropertiesNetworkManagerScopes.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Scope of Network Manager. - /// - public partial class NetworkManagerPropertiesNetworkManagerScopes - { - /// - /// Initializes a new instance of the - /// NetworkManagerPropertiesNetworkManagerScopes class. - /// - public NetworkManagerPropertiesNetworkManagerScopes() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// NetworkManagerPropertiesNetworkManagerScopes class. - /// - /// List of management groups. - /// List of subscriptions. - public NetworkManagerPropertiesNetworkManagerScopes(IList managementGroups = default(IList), IList subscriptions = default(IList)) - { - ManagementGroups = managementGroups; - Subscriptions = subscriptions; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets list of management groups. - /// - [JsonProperty(PropertyName = "managementGroups")] - public IList ManagementGroups { get; set; } - - /// - /// Gets or sets list of subscriptions. - /// - [JsonProperty(PropertyName = "subscriptions")] - public IList Subscriptions { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerSecurityGroupItem.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerSecurityGroupItem.cs deleted file mode 100644 index a85140d0bd77..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkManagerSecurityGroupItem.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Network manager security group item. - /// - public partial class NetworkManagerSecurityGroupItem - { - /// - /// Initializes a new instance of the NetworkManagerSecurityGroupItem - /// class. - /// - public NetworkManagerSecurityGroupItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the NetworkManagerSecurityGroupItem - /// class. - /// - /// Network manager group Id. - public NetworkManagerSecurityGroupItem(string networkGroupId = default(string)) - { - NetworkGroupId = networkGroupId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets network manager group Id. - /// - [JsonProperty(PropertyName = "networkGroupId")] - public string NetworkGroupId { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkRule.cs index 7a0279f4f82e..feebc1b0ae05 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkRule.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkRule.cs @@ -18,6 +18,7 @@ namespace Microsoft.Azure.Management.Network.Models /// /// Rule of type network. /// + [Newtonsoft.Json.JsonObject("NetworkRule")] public partial class NetworkRule : FirewallPolicyRule { /// diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkSecurityPerimeter.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkSecurityPerimeter.cs deleted file mode 100644 index 7882f7a10120..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkSecurityPerimeter.cs +++ /dev/null @@ -1,94 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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 Security Perimeter resource - /// - [Rest.Serialization.JsonTransformation] - public partial class NetworkSecurityPerimeter : Resource - { - /// - /// Initializes a new instance of the NetworkSecurityPerimeter class. - /// - public NetworkSecurityPerimeter() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the NetworkSecurityPerimeter class. - /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// A friendly name for the network security - /// perimeter. - /// A description of the network security - /// perimeter. - /// The provisioning state of the scope - /// assignment resource. Possible values include: 'Succeeded', - /// 'Updating', 'Deleting', 'Failed' - /// A unique read-only string that changes whenever - /// the resource is updated. - public NetworkSecurityPerimeter(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string displayName = default(string), string description = default(string), string provisioningState = default(string), string etag = default(string)) - : base(id, name, type, location, tags) - { - DisplayName = displayName; - Description = description; - ProvisioningState = provisioningState; - Etag = etag; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a friendly name for the network security perimeter. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets a description of the network security perimeter. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// 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; } - - /// - /// Gets a unique read-only string that changes whenever the resource - /// is updated. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkVirtualAppliance.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkVirtualAppliance.cs index e56c23395ae6..35972f2b397d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkVirtualAppliance.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/NetworkVirtualAppliance.cs @@ -52,6 +52,7 @@ public NetworkVirtualAppliance() /// CloudInitConfiguration string /// in plain text. /// VirtualAppliance ASN. + /// Public key for SSH login. /// List of Virtual Appliance /// Network Interfaces. /// List of references to @@ -65,7 +66,7 @@ public NetworkVirtualAppliance() /// 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?), IList virtualApplianceNics = default(IList), IList virtualApplianceSites = default(IList), IList inboundSecurityRules = default(IList), string provisioningState = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), string etag = default(string)) + 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 virtualApplianceSites = default(IList), IList inboundSecurityRules = default(IList), string provisioningState = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), string etag = default(string)) : base(id, name, type, location, tags) { NvaSku = nvaSku; @@ -75,6 +76,7 @@ public NetworkVirtualAppliance() CloudInitConfigurationBlobs = cloudInitConfigurationBlobs; CloudInitConfiguration = cloudInitConfiguration; VirtualApplianceAsn = virtualApplianceAsn; + SshPublicKey = sshPublicKey; VirtualApplianceNics = virtualApplianceNics; VirtualApplianceSites = virtualApplianceSites; InboundSecurityRules = inboundSecurityRules; @@ -132,6 +134,12 @@ public NetworkVirtualAppliance() [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; } + /// /// Gets list of Virtual Appliance Network Interfaces. /// @@ -179,13 +187,16 @@ public NetworkVirtualAppliance() /// public virtual void Validate() { - if (VirtualApplianceAsn > 4294967295) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "VirtualApplianceAsn", 4294967295); - } - if (VirtualApplianceAsn < 0) + if (VirtualApplianceAsn != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "VirtualApplianceAsn", 0); + if (VirtualApplianceAsn > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "VirtualApplianceAsn", 4294967295); + } + if (VirtualApplianceAsn < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "VirtualApplianceAsn", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCapture.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCapture.cs index 270be9f057ac..0cb6d02efca3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCapture.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCapture.cs @@ -115,29 +115,38 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "StorageLocation"); } - if (BytesToCapturePerPacket > 4294967295) + if (BytesToCapturePerPacket != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "BytesToCapturePerPacket", 4294967295); + if (BytesToCapturePerPacket > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "BytesToCapturePerPacket", 4294967295); + } + if (BytesToCapturePerPacket < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "BytesToCapturePerPacket", 0); + } } - if (BytesToCapturePerPacket < 0) + if (TotalBytesPerSession != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "BytesToCapturePerPacket", 0); + if (TotalBytesPerSession > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "TotalBytesPerSession", 4294967295); + } + if (TotalBytesPerSession < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "TotalBytesPerSession", 0); + } } - if (TotalBytesPerSession > 4294967295) + if (TimeLimitInSeconds != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "TotalBytesPerSession", 4294967295); - } - if (TotalBytesPerSession < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "TotalBytesPerSession", 0); - } - if (TimeLimitInSeconds > 18000) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "TimeLimitInSeconds", 18000); - } - if (TimeLimitInSeconds < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "TimeLimitInSeconds", 0); + if (TimeLimitInSeconds > 18000) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "TimeLimitInSeconds", 18000); + } + if (TimeLimitInSeconds < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "TimeLimitInSeconds", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureParameters.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureParameters.cs index a8a225ae7b4b..e791803e4fad 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureParameters.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureParameters.cs @@ -113,29 +113,38 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "StorageLocation"); } - if (BytesToCapturePerPacket > 4294967295) + if (BytesToCapturePerPacket != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "BytesToCapturePerPacket", 4294967295); + if (BytesToCapturePerPacket > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "BytesToCapturePerPacket", 4294967295); + } + if (BytesToCapturePerPacket < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "BytesToCapturePerPacket", 0); + } } - if (BytesToCapturePerPacket < 0) + if (TotalBytesPerSession != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "BytesToCapturePerPacket", 0); + if (TotalBytesPerSession > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "TotalBytesPerSession", 4294967295); + } + if (TotalBytesPerSession < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "TotalBytesPerSession", 0); + } } - if (TotalBytesPerSession > 4294967295) + if (TimeLimitInSeconds != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "TotalBytesPerSession", 4294967295); - } - if (TotalBytesPerSession < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "TotalBytesPerSession", 0); - } - if (TimeLimitInSeconds > 18000) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "TimeLimitInSeconds", 18000); - } - if (TimeLimitInSeconds < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "TimeLimitInSeconds", 0); + if (TimeLimitInSeconds > 18000) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "TimeLimitInSeconds", 18000); + } + if (TimeLimitInSeconds < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "TimeLimitInSeconds", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureResult.cs index cdd1a0f896be..ed6a805dc78e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureResult.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PacketCaptureResult.cs @@ -152,29 +152,38 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "StorageLocation"); } - if (BytesToCapturePerPacket > 4294967295) + if (BytesToCapturePerPacket != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "BytesToCapturePerPacket", 4294967295); + if (BytesToCapturePerPacket > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "BytesToCapturePerPacket", 4294967295); + } + if (BytesToCapturePerPacket < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "BytesToCapturePerPacket", 0); + } } - if (BytesToCapturePerPacket < 0) + if (TotalBytesPerSession != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "BytesToCapturePerPacket", 0); + if (TotalBytesPerSession > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "TotalBytesPerSession", 4294967295); + } + if (TotalBytesPerSession < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "TotalBytesPerSession", 0); + } } - if (TotalBytesPerSession > 4294967295) + if (TimeLimitInSeconds != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "TotalBytesPerSession", 4294967295); - } - if (TotalBytesPerSession < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "TotalBytesPerSession", 0); - } - if (TimeLimitInSeconds > 18000) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "TimeLimitInSeconds", 18000); - } - if (TimeLimitInSeconds < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "TimeLimitInSeconds", 0); + if (TimeLimitInSeconds > 18000) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "TimeLimitInSeconds", 18000); + } + if (TimeLimitInSeconds < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "TimeLimitInSeconds", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PerimeterAssociableResource.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PerimeterAssociableResource.cs deleted file mode 100644 index 14e898b1e6cb..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PerimeterAssociableResource.cs +++ /dev/null @@ -1,84 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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; - - /// - /// Resource that is onboarded to use network security perimeter. Also - /// referred as perimeter associable resource. - /// - [Rest.Serialization.JsonTransformation] - public partial class PerimeterAssociableResource : Resource - { - /// - /// Initializes a new instance of the PerimeterAssociableResource - /// class. - /// - public PerimeterAssociableResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PerimeterAssociableResource - /// class. - /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// Resource location. - /// Resource tags. - /// A friendly name for the properties of - /// perimeter associable resources. - /// Resource type/provider name. - /// Public DNS zone names of the - /// resources. - public PerimeterAssociableResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string displayName = default(string), string resourceType = default(string), IList publicDnsZones = default(IList)) - : base(id, name, type, location, tags) - { - DisplayName = displayName; - ResourceType = resourceType; - PublicDnsZones = publicDnsZones; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets a friendly name for the properties of perimeter associable - /// resources. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; private set; } - - /// - /// Gets resource type/provider name. - /// - [JsonProperty(PropertyName = "properties.resourceType")] - public string ResourceType { get; private set; } - - /// - /// Gets public DNS zone names of the resources. - /// - [JsonProperty(PropertyName = "properties.publicDnsZones")] - public IList PublicDnsZones { get; private set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PerimeterAssociableResourcesListResult.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PerimeterAssociableResourcesListResult.cs deleted file mode 100644 index 7841fb7b56a8..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PerimeterAssociableResourcesListResult.cs +++ /dev/null @@ -1,65 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Paged list of perimeter associable resources. - /// - public partial class PerimeterAssociableResourcesListResult - { - /// - /// Initializes a new instance of the - /// PerimeterAssociableResourcesListResult class. - /// - public PerimeterAssociableResourcesListResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// PerimeterAssociableResourcesListResult class. - /// - /// Gets paged list of perimeter associable - /// resources. - /// Gets the URL to get the next page of - /// results. - public PerimeterAssociableResourcesListResult(IList value = default(IList), string nextLink = default(string)) - { - Value = value; - NextLink = nextLink; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets paged list of perimeter associable resources. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - - /// - /// Gets the URL to get the next page of results. - /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PolicySettings.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PolicySettings.cs index 69188a800488..1e003d19090e 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PolicySettings.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PolicySettings.cs @@ -95,17 +95,19 @@ public PolicySettings() /// public virtual void Validate() { - if (MaxRequestBodySizeInKb > 128) + if (MaxRequestBodySizeInKb != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxRequestBodySizeInKb", 128); + if (MaxRequestBodySizeInKb < 8) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxRequestBodySizeInKb", 8); + } } - if (MaxRequestBodySizeInKb < 8) + if (FileUploadLimitInMb != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxRequestBodySizeInKb", 8); - } - if (FileUploadLimitInMb < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "FileUploadLimitInMb", 0); + if (FileUploadLimitInMb < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "FileUploadLimitInMb", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityTopology.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PreferredRoutingGateway.cs similarity index 64% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityTopology.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PreferredRoutingGateway.cs index bc7499e64980..0e8946f41322 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ConnectivityTopology.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PreferredRoutingGateway.cs @@ -12,11 +12,12 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for ConnectivityTopology. + /// Defines values for PreferredRoutingGateway. /// - public static class ConnectivityTopology + public static class PreferredRoutingGateway { - public const string HubAndSpoke = "HubAndSpoke"; - public const string Mesh = "Mesh"; + public const string ExpressRoute = "ExpressRoute"; + public const string VpnGateway = "VpnGateway"; + public const string None = "None"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpoint.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpoint.cs index e4977861001f..a1bb0fdda2b0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpoint.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpoint.cs @@ -56,9 +56,16 @@ public PrivateEndpoint() /// 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), string etag = default(string)) + 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) { ExtendedLocation = extendedLocation; @@ -68,6 +75,9 @@ public PrivateEndpoint() PrivateLinkServiceConnections = privateLinkServiceConnections; ManualPrivateLinkServiceConnections = manualPrivateLinkServiceConnections; CustomDnsConfigs = customDnsConfigs; + ApplicationSecurityGroups = applicationSecurityGroups; + IpConfigurations = ipConfigurations; + CustomNetworkInterfaceName = customNetworkInterfaceName; Etag = etag; CustomInit(); } @@ -126,6 +136,27 @@ public PrivateEndpoint() [JsonProperty(PropertyName = "properties.customDnsConfigs")] public IList CustomDnsConfigs { get; set; } + /// + /// Gets or sets application security groups in which the private + /// endpoint IP configuration is included. + /// + [JsonProperty(PropertyName = "properties.applicationSecurityGroups")] + public 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. + /// + [JsonProperty(PropertyName = "properties.ipConfigurations")] + public IList IpConfigurations { get; set; } + + /// + /// Gets or sets the custom name of the network interface attached to + /// the private endpoint. + /// + [JsonProperty(PropertyName = "properties.customNetworkInterfaceName")] + public string CustomNetworkInterfaceName { get; set; } + /// /// Gets a unique read-only string that changes whenever the resource /// is updated. @@ -133,28 +164,5 @@ public PrivateEndpoint() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ExtendedLocation != null) - { - ExtendedLocation.Validate(); - } - if (NetworkInterfaces != null) - { - foreach (var element in NetworkInterfaces) - { - if (element != null) - { - element.Validate(); - } - } - } - } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpointConnection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpointConnection.cs index 484410d7d937..575e64c9ed23 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpointConnection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpointConnection.cs @@ -113,18 +113,5 @@ public PrivateEndpointConnection() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (PrivateEndpoint != null) - { - PrivateEndpoint.Validate(); - } - } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpointIPConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpointIPConfiguration.cs new file mode 100644 index 000000000000..10ee8558b747 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateEndpointIPConfiguration.cs @@ -0,0 +1,107 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// An IP Configuration of the private endpoint. + /// + [Rest.Serialization.JsonTransformation] + public partial class PrivateEndpointIPConfiguration + { + /// + /// Initializes a new instance of the PrivateEndpointIPConfiguration + /// class. + /// + public PrivateEndpointIPConfiguration() + { + CustomInit(); + } + + /// + /// 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)) + { + GroupId = groupId; + MemberName = memberName; + PrivateIPAddress = privateIPAddress; + Name = name; + Type = type; + Etag = etag; + 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. + /// + [JsonProperty(PropertyName = "properties.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. + /// + [JsonProperty(PropertyName = "properties.memberName")] + public string MemberName { get; set; } + + /// + /// Gets or sets a private ip address obtained from the private + /// endpoint's subnet. + /// + [JsonProperty(PropertyName = "properties.privateIPAddress")] + public string PrivateIPAddress { get; set; } + + /// + /// Gets or sets the name of the resource that is unique within a + /// resource group. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets the resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { 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; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateLinkService.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateLinkService.cs index 4280b3ff149c..2929365f8956 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateLinkService.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PrivateLinkService.cs @@ -163,48 +163,5 @@ public PrivateLinkService() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ExtendedLocation != null) - { - ExtendedLocation.Validate(); - } - if (LoadBalancerFrontendIpConfigurations != null) - { - foreach (var element in LoadBalancerFrontendIpConfigurations) - { - if (element != null) - { - element.Validate(); - } - } - } - if (NetworkInterfaces != null) - { - foreach (var element1 in NetworkInterfaces) - { - if (element1 != null) - { - element1.Validate(); - } - } - } - if (PrivateEndpointConnections != null) - { - foreach (var element2 in PrivateEndpointConnections) - { - if (element2 != null) - { - element2.Validate(); - } - } - } - } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ProxyResource.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ProxyResource.cs deleted file mode 100644 index 8480d098c562..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ProxyResource.cs +++ /dev/null @@ -1,79 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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 ProxyResource : IResource - { - /// - /// Initializes a new instance of the ProxyResource class. - /// - public ProxyResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ProxyResource class. - /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - public ProxyResource(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) - { - Id = id; - Name = name; - Type = type; - Etag = etag; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets resource ID. - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets resource name. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - - /// - /// Gets resource type. - /// - [JsonProperty(PropertyName = "type")] - public string Type { 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; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPPrefix.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPPrefix.cs index 83118c047128..9492698563f9 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPPrefix.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIPPrefix.cs @@ -182,18 +182,5 @@ public PublicIPPrefix() [JsonProperty(PropertyName = "zones")] public IList Zones { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ExtendedLocation != null) - { - ExtendedLocation.Validate(); - } - } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddress.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddress.cs index 97606232a8c1..e3988bc735bb 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddress.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/PublicIpAddress.cs @@ -75,11 +75,14 @@ public PublicIPAddress() /// '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 etag = default(string), IList zones = default(IList)) + 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) { ExtendedLocation = extendedLocation; @@ -99,6 +102,7 @@ public PublicIPAddress() NatGateway = natGateway; MigrationPhase = migrationPhase; LinkedPublicIPAddress = linkedPublicIPAddress; + DeleteOption = deleteOption; Etag = etag; Zones = zones; CustomInit(); @@ -223,6 +227,13 @@ public PublicIPAddress() [JsonProperty(PropertyName = "properties.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' + /// + [JsonProperty(PropertyName = "properties.deleteOption")] + public string DeleteOption { get; set; } + /// /// Gets a unique read-only string that changes whenever the resource /// is updated. @@ -237,30 +248,5 @@ public PublicIPAddress() [JsonProperty(PropertyName = "zones")] public IList Zones { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ExtendedLocation != null) - { - ExtendedLocation.Validate(); - } - if (IpConfiguration != null) - { - IpConfiguration.Validate(); - } - if (ServicePublicIPAddress != null) - { - ServicePublicIPAddress.Validate(); - } - if (LinkedPublicIPAddress != null) - { - LinkedPublicIPAddress.Validate(); - } - } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/QosDefinition.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/QosDefinition.cs new file mode 100644 index 000000000000..5c02d0815067 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/QosDefinition.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 Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Quality of Service defines the traffic configuration between endpoints. + /// Mandatory to have one marking. + /// + public partial class QosDefinition + { + /// + /// Initializes a new instance of the QosDefinition class. + /// + public QosDefinition() + { + CustomInit(); + } + + /// + /// 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)) + { + Markings = markings; + SourceIpRanges = sourceIpRanges; + DestinationIpRanges = destinationIpRanges; + SourcePortRanges = sourcePortRanges; + DestinationPortRanges = destinationPortRanges; + Protocol = protocol; + 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. + /// + [JsonProperty(PropertyName = "markings")] + public IList Markings { get; set; } + + /// + /// Gets or sets source IP ranges. + /// + [JsonProperty(PropertyName = "sourceIpRanges")] + public IList SourceIpRanges { get; set; } + + /// + /// Gets or sets destination IP ranges. + /// + [JsonProperty(PropertyName = "destinationIpRanges")] + public IList DestinationIpRanges { get; set; } + + /// + /// Gets or sets sources port ranges. + /// + [JsonProperty(PropertyName = "sourcePortRanges")] + public IList SourcePortRanges { get; set; } + + /// + /// Gets or sets destination port ranges. + /// + [JsonProperty(PropertyName = "destinationPortRanges")] + public IList DestinationPortRanges { get; set; } + + /// + /// 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; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/QueryRequestOptions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/QueryRequestOptions.cs deleted file mode 100644 index 2f0f13cbc502..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/QueryRequestOptions.cs +++ /dev/null @@ -1,55 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Query Request Options - /// - public partial class QueryRequestOptions - { - /// - /// Initializes a new instance of the QueryRequestOptions class. - /// - public QueryRequestOptions() - { - CustomInit(); - } - - /// - /// 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. - public QueryRequestOptions(string skipToken = default(string)) - { - SkipToken = skipToken; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - 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. - /// - [JsonProperty(PropertyName = "skipToken")] - public string SkipToken { get; set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/RuleCollection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/RuleCollection.cs deleted file mode 100644 index 2cca3c7c7b08..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/RuleCollection.cs +++ /dev/null @@ -1,100 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Defines the rule collection. - /// - [Rest.Serialization.JsonTransformation] - public partial class RuleCollection : ProxyResource - { - /// - /// Initializes a new instance of the RuleCollection class. - /// - public RuleCollection() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the RuleCollection class. - /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// A display name of the rule - /// collection. - /// A description of the rule - /// collection. - /// Groups for configuration - /// The provisioning state of the - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// The system metadata related to this - /// resource. - public RuleCollection(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string displayName = default(string), string description = default(string), IList appliesToGroups = default(IList), string provisioningState = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type, etag) - { - DisplayName = displayName; - Description = description; - AppliesToGroups = appliesToGroups; - ProvisioningState = provisioningState; - SystemData = systemData; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a display name of the rule collection. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets a description of the rule collection. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets groups for configuration - /// - [JsonProperty(PropertyName = "properties.appliesToGroups")] - public IList AppliesToGroups { 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; } - - /// - /// Gets the system metadata related to this resource. - /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfiguration.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfiguration.cs deleted file mode 100644 index 7656ef08ae43..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfiguration.cs +++ /dev/null @@ -1,111 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Defines the security configuration - /// - [Rest.Serialization.JsonTransformation] - public partial class SecurityConfiguration : ProxyResource - { - /// - /// Initializes a new instance of the SecurityConfiguration class. - /// - public SecurityConfiguration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SecurityConfiguration class. - /// - /// Resource ID. - /// Resource name. - /// Resource type. - /// A unique read-only string that changes whenever - /// the resource is updated. - /// A display name of the security - /// configuration. - /// A description of the security - /// configuration. - /// Security Type. Possible values include: - /// 'AdminPolicy', 'UserPolicy' - /// Flag if need to delete existing - /// network security groups. Possible values include: 'False', - /// 'True' - /// The provisioning state of the - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// The system metadata related to this - /// resource. - public SecurityConfiguration(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string displayName = default(string), string description = default(string), string securityType = default(string), string deleteExistingNSGs = default(string), string provisioningState = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type, etag) - { - DisplayName = displayName; - Description = description; - SecurityType = securityType; - DeleteExistingNSGs = deleteExistingNSGs; - ProvisioningState = provisioningState; - SystemData = systemData; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a display name of the security configuration. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets a description of the security configuration. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets security Type. Possible values include: 'AdminPolicy', - /// 'UserPolicy' - /// - [JsonProperty(PropertyName = "properties.securityType")] - public string SecurityType { get; set; } - - /// - /// Gets or sets flag if need to delete existing network security - /// groups. Possible values include: 'False', 'True' - /// - [JsonProperty(PropertyName = "properties.deleteExistingNSGs")] - public string DeleteExistingNSGs { 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; } - - /// - /// Gets the system metadata related to this resource. - /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleAccess.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleAccess.cs deleted file mode 100644 index 8fa24ddae16e..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleAccess.cs +++ /dev/null @@ -1,23 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 SecurityConfigurationRuleAccess. - /// - public static class SecurityConfigurationRuleAccess - { - public const string Allow = "Allow"; - public const string Deny = "Deny"; - public const string AlwaysAllow = "AlwaysAllow"; - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleDirection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleDirection.cs deleted file mode 100644 index 266a50b5281a..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleDirection.cs +++ /dev/null @@ -1,22 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 SecurityConfigurationRuleDirection. - /// - public static class SecurityConfigurationRuleDirection - { - public const string Inbound = "Inbound"; - public const string Outbound = "Outbound"; - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleProtocol.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleProtocol.cs deleted file mode 100644 index d4ca62c2e1b8..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityConfigurationRuleProtocol.cs +++ /dev/null @@ -1,26 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 SecurityConfigurationRuleProtocol. - /// - public static class SecurityConfigurationRuleProtocol - { - public const string Tcp = "Tcp"; - public const string Udp = "Udp"; - public const string Icmp = "Icmp"; - public const string Esp = "Esp"; - public const string Any = "Any"; - public const string Ah = "Ah"; - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityType.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityType.cs deleted file mode 100644 index 917cef4ae48f..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SecurityType.cs +++ /dev/null @@ -1,22 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 SecurityType. - /// - public static class SecurityType - { - public const string AdminPolicy = "AdminPolicy"; - public const string UserPolicy = "UserPolicy"; - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceEndpointPolicy.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceEndpointPolicy.cs index 3798ebe8dbc2..e3d82550d22b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceEndpointPolicy.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceEndpointPolicy.cs @@ -49,17 +49,23 @@ public ServiceEndpointPolicy() /// 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 etag = default(string), string kind = default(string)) + 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) { ServiceEndpointPolicyDefinitions = serviceEndpointPolicyDefinitions; Subnets = subnets; ResourceGuid = resourceGuid; ProvisioningState = provisioningState; + ServiceAlias = serviceAlias; + ContextualServiceEndpointPolicies = contextualServiceEndpointPolicies; Etag = etag; Kind = kind; CustomInit(); @@ -98,6 +104,19 @@ public ServiceEndpointPolicy() [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } + /// + /// Gets or sets the alias indicating if the policy belongs to a + /// service + /// + [JsonProperty(PropertyName = "properties.serviceAlias")] + public string ServiceAlias { get; set; } + + /// + /// Gets or sets a collection of contextual service endpoint policy. + /// + [JsonProperty(PropertyName = "properties.contextualServiceEndpointPolicies")] + public IList ContextualServiceEndpointPolicies { get; set; } + /// /// Gets a unique read-only string that changes whenever the resource /// is updated. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceEndpointPolicyDefinition.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceEndpointPolicyDefinition.cs index 64925fb12dbd..5a61927972e8 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceEndpointPolicyDefinition.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceEndpointPolicyDefinition.cs @@ -49,7 +49,8 @@ public ServiceEndpointPolicyDefinition() /// resource. /// A unique read-only string that changes whenever /// the resource is updated. - 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)) + /// 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) { Description = description; @@ -58,6 +59,7 @@ public ServiceEndpointPolicyDefinition() ProvisioningState = provisioningState; Name = name; Etag = etag; + Type = type; CustomInit(); } @@ -106,5 +108,11 @@ public ServiceEndpointPolicyDefinition() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } + /// + /// Gets or sets the type of the resource. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceTagInformation.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceTagInformation.cs index c64dd78c96f1..7043aa989779 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceTagInformation.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/ServiceTagInformation.cs @@ -33,11 +33,14 @@ public ServiceTagInformation() /// information. /// The name of service tag. /// The ID of service tag. - public ServiceTagInformation(ServiceTagInformationPropertiesFormat properties = default(ServiceTagInformationPropertiesFormat), string name = default(string), string id = default(string)) + /// 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; CustomInit(); } @@ -64,5 +67,11 @@ public ServiceTagInformation() [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; } + } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GroupMembersItem.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Sku.cs similarity index 60% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GroupMembersItem.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Sku.cs index 51e0ebe19d36..75f172a4cef6 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/GroupMembersItem.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/Sku.cs @@ -14,25 +14,26 @@ namespace Microsoft.Azure.Management.Network.Models using System.Linq; /// - /// GroupMembers Item. + /// The sku of this Bastion Host. /// - public partial class GroupMembersItem + public partial class Sku { /// - /// Initializes a new instance of the GroupMembersItem class. + /// Initializes a new instance of the Sku class. /// - public GroupMembersItem() + public Sku() { CustomInit(); } /// - /// Initializes a new instance of the GroupMembersItem class. + /// Initializes a new instance of the Sku class. /// - /// Resource Id. - public GroupMembersItem(string resourceId = default(string)) + /// The name of this Bastion Host. Possible values + /// include: 'Basic', 'Standard' + public Sku(string name = default(string)) { - ResourceId = resourceId; + Name = name; CustomInit(); } @@ -42,10 +43,11 @@ public GroupMembersItem() partial void CustomInit(); /// - /// Gets or sets resource Id. + /// Gets or sets the name of this Bastion Host. Possible values + /// include: 'Basic', 'Standard' /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IsGlobal.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SyncRemoteAddressSpace.cs similarity index 74% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IsGlobal.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SyncRemoteAddressSpace.cs index 11c8db830ff0..80df58a83add 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/IsGlobal.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SyncRemoteAddressSpace.cs @@ -12,11 +12,10 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for IsGlobal. + /// Defines values for SyncRemoteAddressSpace. /// - public static class IsGlobal + public static class SyncRemoteAddressSpace { - public const string False = "False"; - public const string True = "True"; + public const string True = "true"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SystemData.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SystemData.cs deleted file mode 100644 index c8f4a089574c..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/SystemData.cs +++ /dev/null @@ -1,103 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Metadata pertaining to creation and last modification of the resource. - /// - public partial class SystemData - { - /// - /// Initializes a new instance of the SystemData class. - /// - public SystemData() - { - CustomInit(); - } - - /// - /// 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. - 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; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the identity that created the resource. - /// - [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' - /// - [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; } - - /// - /// Gets or sets the identity that last modified the resource. - /// - [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' - /// - [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; } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UserRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UserRule.cs deleted file mode 100644 index 27563356a0c2..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/UserRule.cs +++ /dev/null @@ -1,159 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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 user rule. - /// - [Newtonsoft.Json.JsonObject("Custom")] - [Rest.Serialization.JsonTransformation] - public partial class UserRule : BaseUserRule - { - /// - /// Initializes a new instance of the UserRule class. - /// - public UserRule() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the UserRule class. - /// - /// Network protocol this rule applies to. - /// Possible values include: 'Tcp', 'Udp', 'Icmp', 'Esp', 'Any', - /// 'Ah' - /// 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 friendly name for the rule. - /// A description for this rule. - /// 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 - /// security configuration user rule resource. Possible values include: - /// 'Succeeded', 'Updating', 'Deleting', 'Failed' - public UserRule(string protocol, string direction, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), SystemData systemData = default(SystemData), string displayName = default(string), string description = default(string), IList sources = default(IList), IList destinations = default(IList), IList sourcePortRanges = default(IList), IList destinationPortRanges = default(IList), string provisioningState = default(string)) - : base(id, name, type, etag, systemData) - { - DisplayName = displayName; - Description = description; - Protocol = protocol; - Sources = sources; - Destinations = destinations; - SourcePortRanges = sourcePortRanges; - DestinationPortRanges = destinationPortRanges; - Direction = direction; - ProvisioningState = provisioningState; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a friendly name for the rule. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets a description for this rule. - /// - [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' - /// - [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; } - - /// - /// Gets or sets the destination address prefixes. CIDR or destination - /// IP ranges. - /// - [JsonProperty(PropertyName = "properties.destinations")] - public IList Destinations { get; set; } - - /// - /// Gets or sets the source port ranges. - /// - [JsonProperty(PropertyName = "properties.sourcePortRanges")] - public IList SourcePortRanges { get; set; } - - /// - /// Gets or sets the destination port ranges. - /// - [JsonProperty(PropertyName = "properties.destinationPortRanges")] - public IList DestinationPortRanges { get; set; } - - /// - /// 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 security configuration user rule - /// resource. Possible values include: 'Succeeded', 'Updating', - /// 'Deleting', 'Failed' - /// - [JsonProperty(PropertyName = "properties.provisioningState")] - public string ProvisioningState { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Protocol == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); - } - if (Direction == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Direction"); - } - } - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualHub.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualHub.cs index 0f7c9234b6e0..d1746404da5f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualHub.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualHub.cs @@ -73,9 +73,14 @@ public VirtualHub() /// VirtualRouter IPs. /// Flag to control transit /// for VirtualRouter hub. + /// The preferred gateway to + /// route on-prem traffic. Possible values include: 'ExpressRoute', + /// 'VpnGateway', 'None' /// A unique read-only string that changes whenever /// the resource is updated. - 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), long? virtualRouterAsn = default(long?), IList virtualRouterIps = default(IList), bool? allowBranchToBranchTraffic = default(bool?), string etag = default(string)) + /// 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), long? virtualRouterAsn = default(long?), IList virtualRouterIps = default(IList), bool? allowBranchToBranchTraffic = default(bool?), string preferredRoutingGateway = default(string), string etag = default(string), string kind = default(string)) : base(id, name, type, location, tags) { VirtualWan = virtualWan; @@ -96,7 +101,9 @@ public VirtualHub() VirtualRouterAsn = virtualRouterAsn; VirtualRouterIps = virtualRouterIps; AllowBranchToBranchTraffic = allowBranchToBranchTraffic; + PreferredRoutingGateway = preferredRoutingGateway; Etag = etag; + Kind = kind; CustomInit(); } @@ -218,6 +225,13 @@ public VirtualHub() [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' + /// + [JsonProperty(PropertyName = "properties.preferredRoutingGateway")] + public string PreferredRoutingGateway { get; set; } + /// /// Gets a unique read-only string that changes whenever the resource /// is updated. @@ -225,6 +239,13 @@ public VirtualHub() [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; } + /// /// Validate the object. /// @@ -233,13 +254,16 @@ public VirtualHub() /// public virtual void Validate() { - if (VirtualRouterAsn > 4294967295) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "VirtualRouterAsn", 4294967295); - } - if (VirtualRouterAsn < 0) + if (VirtualRouterAsn != null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "VirtualRouterAsn", 0); + if (VirtualRouterAsn > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "VirtualRouterAsn", 4294967295); + } + if (VirtualRouterAsn < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "VirtualRouterAsn", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetwork.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetwork.cs index 3643f4bb762e..6b7af986bcc5 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetwork.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetwork.cs @@ -46,6 +46,8 @@ public VirtualNetwork() /// 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 @@ -69,12 +71,13 @@ public VirtualNetwork() /// this VNET. /// 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), 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), IList ipAllocations = default(IList), string etag = default(string)) + 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), IList ipAllocations = default(IList), string etag = default(string)) : base(id, name, type, location, tags) { ExtendedLocation = extendedLocation; AddressSpace = addressSpace; DhcpOptions = dhcpOptions; + FlowTimeoutInMinutes = flowTimeoutInMinutes; Subnets = subnets; VirtualNetworkPeerings = virtualNetworkPeerings; ResourceGuid = resourceGuid; @@ -113,6 +116,13 @@ public VirtualNetwork() [JsonProperty(PropertyName = "properties.dhcpOptions")] public DhcpOptions DhcpOptions { get; set; } + /// + /// Gets or sets the FlowTimeout value (in minutes) for the Virtual + /// Network + /// + [JsonProperty(PropertyName = "properties.flowTimeoutInMinutes")] + public int? FlowTimeoutInMinutes { get; set; } + /// /// Gets or sets a list of subnets in a Virtual Network. /// @@ -189,10 +199,6 @@ public VirtualNetwork() /// public virtual void Validate() { - if (ExtendedLocation != null) - { - ExtendedLocation.Validate(); - } if (VirtualNetworkPeerings != null) { foreach (var element in VirtualNetworkPeerings) diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGateway.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGateway.cs index 0d055075c65d..7d4dc21f492c 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGateway.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGateway.cs @@ -39,8 +39,6 @@ public VirtualNetworkGateway() /// Resource type. /// Resource location. /// Resource tags. - /// The extended location of type local - /// virtual network gateway. /// IP configurations for virtual /// network gateway. /// The type of this virtual network gateway. @@ -84,12 +82,18 @@ public VirtualNetworkGateway() /// Customer vnet resource /// id. VirtualNetworkGateway of type local gateway is associated with /// the customer vnet. + /// NatRules for virtual network + /// gateway. + /// EnableBgpRouteTranslationForNat + /// flag. + /// 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), ExtendedLocation extendedLocation = default(ExtendedLocation), 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?), SubResource gatewayDefaultSite = default(SubResource), VirtualNetworkGatewaySku sku = default(VirtualNetworkGatewaySku), VpnClientConfiguration vpnClientConfiguration = default(VpnClientConfiguration), 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), string etag = default(string)) + public VirtualNetworkGateway(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 gatewayType = default(string), string vpnType = default(string), string vpnGatewayGeneration = default(string), bool? enableBgp = default(bool?), bool? enablePrivateIpAddress = default(bool?), bool? activeActive = default(bool?), SubResource gatewayDefaultSite = default(SubResource), VirtualNetworkGatewaySku sku = default(VirtualNetworkGatewaySku), VpnClientConfiguration vpnClientConfiguration = default(VpnClientConfiguration), 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?), ExtendedLocation extendedLocation = default(ExtendedLocation), string etag = default(string)) : base(id, name, type, location, tags) { - ExtendedLocation = extendedLocation; IpConfigurations = ipConfigurations; GatewayType = gatewayType; VpnType = vpnType; @@ -107,6 +111,9 @@ public VirtualNetworkGateway() EnableDnsForwarding = enableDnsForwarding; InboundDnsForwardingEndpoint = inboundDnsForwardingEndpoint; VNetExtendedLocationResourceId = vNetExtendedLocationResourceId; + NatRules = natRules; + EnableBgpRouteTranslationForNat = enableBgpRouteTranslationForNat; + ExtendedLocation = extendedLocation; Etag = etag; CustomInit(); } @@ -116,13 +123,6 @@ public VirtualNetworkGateway() /// partial void CustomInit(); - /// - /// Gets or sets the extended location of type local virtual network - /// gateway. - /// - [JsonProperty(PropertyName = "extendedLocation")] - public ExtendedLocation ExtendedLocation { get; set; } - /// /// Gets or sets IP configurations for virtual network gateway. /// @@ -242,6 +242,25 @@ public VirtualNetworkGateway() [JsonProperty(PropertyName = "properties.vNetExtendedLocationResourceId")] public string VNetExtendedLocationResourceId { get; set; } + /// + /// Gets or sets natRules for virtual network gateway. + /// + [JsonProperty(PropertyName = "properties.natRules")] + public IList NatRules { get; set; } + + /// + /// Gets or sets enableBgpRouteTranslationForNat flag. + /// + [JsonProperty(PropertyName = "properties.enableBgpRouteTranslationForNat")] + public bool? EnableBgpRouteTranslationForNat { get; set; } + + /// + /// Gets or sets the extended location of type local virtual network + /// gateway. + /// + [JsonProperty(PropertyName = "extendedLocation")] + public ExtendedLocation ExtendedLocation { get; set; } + /// /// Gets a unique read-only string that changes whenever the resource /// is updated. @@ -257,10 +276,6 @@ public VirtualNetworkGateway() /// public virtual void Validate() { - if (ExtendedLocation != null) - { - ExtendedLocation.Validate(); - } if (BgpSettings != null) { BgpSettings.Validate(); diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayConnection.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayConnection.cs index 099f51438b2d..467f31a4a4b3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayConnection.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayConnection.cs @@ -29,7 +29,6 @@ public partial class VirtualNetworkGatewayConnection : Resource /// public VirtualNetworkGatewayConnection() { - VirtualNetworkGateway1 = new VirtualNetworkGateway(); CustomInit(); } @@ -52,6 +51,8 @@ public VirtualNetworkGatewayConnection() /// 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. @@ -89,13 +90,15 @@ public VirtualNetworkGatewayConnection() /// for data forwarding. /// 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), 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?), 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?), string etag = default(string)) + 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?), 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?), string etag = default(string)) : base(id, name, type, location, tags) { AuthorizationKey = authorizationKey; VirtualNetworkGateway1 = virtualNetworkGateway1; VirtualNetworkGateway2 = virtualNetworkGateway2; LocalNetworkGateway2 = localNetworkGateway2; + IngressNatRules = ingressNatRules; + EgressNatRules = egressNatRules; ConnectionType = connectionType; ConnectionProtocol = connectionProtocol; RoutingWeight = routingWeight; @@ -148,6 +151,18 @@ public VirtualNetworkGatewayConnection() [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; } + + /// + /// Gets or sets list of egress NatRules. + /// + [JsonProperty(PropertyName = "properties.egressNatRules")] + public IList EgressNatRules { get; set; } + /// /// Gets or sets gateway connection type. Possible values include: /// 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayNatRule.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayNatRule.cs new file mode 100644 index 000000000000..f869335babac --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkGatewayNatRule.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 Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// VirtualNetworkGatewayNatRule Resource. + /// + [Rest.Serialization.JsonTransformation] + public partial class VirtualNetworkGatewayNatRule : SubResource + { + /// + /// Initializes a new instance of the VirtualNetworkGatewayNatRule + /// class. + /// + public VirtualNetworkGatewayNatRule() + { + CustomInit(); + } + + /// + /// 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) + { + ProvisioningState = provisioningState; + VirtualNetworkGatewayNatRulePropertiesType = virtualNetworkGatewayNatRulePropertiesType; + Mode = mode; + InternalMappings = internalMappings; + ExternalMappings = externalMappings; + IpConfigurationId = ipConfigurationId; + Name = name; + Etag = etag; + Type = type; + 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' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets the type of NAT rule for VPN NAT. Possible values + /// include: 'Static', 'Dynamic' + /// + [JsonProperty(PropertyName = "properties.type")] + public string VirtualNetworkGatewayNatRulePropertiesType { get; set; } + + /// + /// Gets or sets the Source NAT direction of a VPN NAT. Possible values + /// include: 'EgressSnat', 'IngressSnat' + /// + [JsonProperty(PropertyName = "properties.mode")] + public string Mode { get; set; } + + /// + /// Gets or sets the private IP address internal mapping for NAT. + /// + [JsonProperty(PropertyName = "properties.internalMappings")] + public IList InternalMappings { get; set; } + + /// + /// Gets or sets the private IP address external mapping for NAT. + /// + [JsonProperty(PropertyName = "properties.externalMappings")] + public IList ExternalMappings { get; set; } + + /// + /// Gets or sets the IP Configuration ID this NAT rule applies to. + /// + [JsonProperty(PropertyName = "properties.ipConfigurationId")] + public string IpConfigurationId { 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; } + + /// + /// Gets resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + } +} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeering.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeering.cs index 03b45c99a365..23b92cca42f4 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeering.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeering.cs @@ -52,13 +52,19 @@ public VirtualNetworkPeering() /// 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 remote - /// virtual network address space. + /// 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 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' @@ -72,7 +78,7 @@ public VirtualNetworkPeering() /// 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), VirtualNetworkBgpCommunities remoteBgpCommunities = default(VirtualNetworkBgpCommunities), string peeringState = 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)) + 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), 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) { AllowVirtualNetworkAccess = allowVirtualNetworkAccess; @@ -81,8 +87,10 @@ public VirtualNetworkPeering() UseRemoteGateways = useRemoteGateways; RemoteVirtualNetwork = remoteVirtualNetwork; RemoteAddressSpace = remoteAddressSpace; + RemoteVirtualNetworkAddressSpace = remoteVirtualNetworkAddressSpace; RemoteBgpCommunities = remoteBgpCommunities; PeeringState = peeringState; + PeeringSyncLevel = peeringSyncLevel; ProvisioningState = provisioningState; DoNotVerifyRemoteGateways = doNotVerifyRemoteGateways; ResourceGuid = resourceGuid; @@ -140,12 +148,19 @@ public VirtualNetworkPeering() public SubResource RemoteVirtualNetwork { get; set; } /// - /// Gets or sets the reference to the remote virtual network address - /// space. + /// Gets or sets the reference to the address space peered with the + /// remote virtual network. /// [JsonProperty(PropertyName = "properties.remoteAddressSpace")] public AddressSpace RemoteAddressSpace { get; set; } + /// + /// Gets or sets the reference to the current address space of the + /// remote virtual network. + /// + [JsonProperty(PropertyName = "properties.remoteVirtualNetworkAddressSpace")] + public AddressSpace RemoteVirtualNetworkAddressSpace { get; set; } + /// /// Gets or sets the reference to the remote virtual network's Bgp /// Communities. @@ -160,6 +175,14 @@ public VirtualNetworkPeering() [JsonProperty(PropertyName = "properties.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' + /// + [JsonProperty(PropertyName = "properties.peeringSyncLevel")] + public string PeeringSyncLevel { get; set; } + /// /// Gets the provisioning state of the virtual network peering /// resource. Possible values include: 'Succeeded', 'Updating', diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CreatedByType.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeeringLevel.cs similarity index 55% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CreatedByType.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeeringLevel.cs index f360566a259f..4ba41da779d6 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/CreatedByType.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkPeeringLevel.cs @@ -12,13 +12,13 @@ namespace Microsoft.Azure.Management.Network.Models { /// - /// Defines values for CreatedByType. + /// Defines values for VirtualNetworkPeeringLevel. /// - public static class CreatedByType + public static class VirtualNetworkPeeringLevel { - public const string User = "User"; - public const string Application = "Application"; - public const string ManagedIdentity = "ManagedIdentity"; - public const string Key = "Key"; + public const string FullyInSync = "FullyInSync"; + public const string RemoteNotInSync = "RemoteNotInSync"; + public const string LocalNotInSync = "LocalNotInSync"; + public const string LocalAndRemoteNotInSync = "LocalAndRemoteNotInSync"; } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkTap.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkTap.cs index 18f6870e7822..fae7eacd4bbb 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkTap.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualNetworkTap.cs @@ -125,32 +125,5 @@ public VirtualNetworkTap() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (NetworkInterfaceTapConfigurations != null) - { - foreach (var element in NetworkInterfaceTapConfigurations) - { - if (element != null) - { - element.Validate(); - } - } - } - if (DestinationNetworkInterfaceIPConfiguration != null) - { - DestinationNetworkInterfaceIPConfiguration.Validate(); - } - if (DestinationLoadBalancerFrontEndIPConfiguration != null) - { - DestinationLoadBalancerFrontEndIPConfiguration.Validate(); - } - } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualRouter.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualRouter.cs index 970f9a3fe686..e6a1b590c68a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualRouter.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualRouter.cs @@ -122,13 +122,16 @@ public VirtualRouter() /// public virtual void Validate() { - if (VirtualRouterAsn > 4294967295) + if (VirtualRouterAsn != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "VirtualRouterAsn", 4294967295); - } - if (VirtualRouterAsn < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "VirtualRouterAsn", 0); + if (VirtualRouterAsn > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "VirtualRouterAsn", 4294967295); + } + if (VirtualRouterAsn < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "VirtualRouterAsn", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualRouterPeering.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualRouterPeering.cs index 356b2fda9334..35a8277064c2 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualRouterPeering.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VirtualRouterPeering.cs @@ -107,13 +107,16 @@ public VirtualRouterPeering() /// public virtual void Validate() { - if (PeerAsn > 4294967295) + if (PeerAsn != null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "PeerAsn", 4294967295); - } - if (PeerAsn < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "PeerAsn", 0); + if (PeerAsn > 4294967295) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "PeerAsn", 4294967295); + } + if (PeerAsn < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "PeerAsn", 0); + } } } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VnetRoute.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VnetRoute.cs index cbaadf636dd9..48c66f30808a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VnetRoute.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VnetRoute.cs @@ -33,9 +33,12 @@ public VnetRoute() /// Initializes a new instance of the VnetRoute class. /// /// List of all Static Routes. - public VnetRoute(IList staticRoutes = default(IList)) + /// The list of references to + /// HubBgpConnection objects. + public VnetRoute(IList staticRoutes = default(IList), IList bgpConnections = default(IList)) { StaticRoutes = staticRoutes; + BgpConnections = bgpConnections; CustomInit(); } @@ -50,5 +53,11 @@ public VnetRoute() [JsonProperty(PropertyName = "staticRoutes")] public IList StaticRoutes { get; set; } + /// + /// Gets the list of references to HubBgpConnection objects. + /// + [JsonProperty(PropertyName = "bgpConnections")] + public IList BgpConnections { get; private set; } + } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnGateway.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnGateway.cs index 4cefb1131c2f..18475785e6db 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnGateway.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/VpnGateway.cs @@ -52,13 +52,15 @@ public VpnGateway() /// 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? isRoutingPreferenceInternet = default(bool?), IList natRules = default(IList), string etag = default(string)) + 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) { VirtualHub = virtualHub; @@ -67,6 +69,7 @@ public VpnGateway() ProvisioningState = provisioningState; VpnGatewayScaleUnit = vpnGatewayScaleUnit; IpConfigurations = ipConfigurations; + EnableBgpRouteTranslationForNat = enableBgpRouteTranslationForNat; IsRoutingPreferenceInternet = isRoutingPreferenceInternet; NatRules = natRules; Etag = etag; @@ -115,6 +118,13 @@ public VpnGateway() [JsonProperty(PropertyName = "properties.ipConfigurations")] public IList IpConfigurations { get; private set; } + /// + /// Gets or sets enable BGP routes translation for NAT on this + /// VpnGateway. + /// + [JsonProperty(PropertyName = "properties.enableBgpRouteTranslationForNat")] + public bool? EnableBgpRouteTranslationForNat { get; set; } + /// /// Gets or sets enable Routing Preference property for the Public IP /// Interface of the VpnGateway. diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatGatewaysOperations.cs index c0bda7c1d48f..dc59a2584d46 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatGatewaysOperations.cs @@ -119,7 +119,7 @@ internal NatGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal NatGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal NatGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -720,7 +720,7 @@ internal NatGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal NatGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1092,7 +1092,7 @@ internal NatGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatRulesOperations.cs index f9ca5ba58ff9..04eb1e81c588 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NatRulesOperations.cs @@ -101,7 +101,7 @@ internal NatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal NatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,7 +560,7 @@ internal NatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "natRuleParameters"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -785,7 +785,7 @@ internal NatRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperations.cs deleted file mode 100644 index 6b2ce397b763..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperations.cs +++ /dev/null @@ -1,1096 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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 - { - /// - /// Initializes a new instance of the NetworkGroupsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal NetworkGroupsOperations(NetworkManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the NetworkManagementClient - /// - public NetworkManagementClient Client { get; private set; } - - /// - /// Gets the specified network group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group to get. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (networkGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkGroupName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new 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); - } - // Construct URL - var _baseUrl = 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("{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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - 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. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group to get. - /// - /// - /// 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (networkGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkGroupName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("ifMatch", ifMatch); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkManagerName", networkManagerName); - tracingParameters.Add("networkGroupName", networkGroupName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); - } - // Construct URL - var _baseUrl = 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("{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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (ifMatch != null) - { - if (_httpRequest.Headers.Contains("If-Match")) - { - _httpRequest.Headers.Remove("If-Match"); - } - _httpRequest.Headers.TryAddWithoutValidation("If-Match", ifMatch); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _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); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - 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)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - try - { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes a network group. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group to get. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (networkGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkGroupName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new 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, "Delete", tracingParameters); - } - // Construct URL - var _baseUrl = 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("{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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - 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)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _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); - } - return _result; - } - - /// - /// Lists the specified network group. - /// - /// - /// 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (top > 20) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); - } - if (top < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new 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); - } - // Construct URL - var _baseUrl = 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new 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('"')))); - } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Lists the specified network group. - /// - /// - /// The NextLink from the previous successful call to List 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperationsExtensions.cs deleted file mode 100644 index c3edfff097eb..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkGroupsOperationsExtensions.cs +++ /dev/null @@ -1,270 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// 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 to get. - /// - 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 to get. - /// - /// - /// 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; - } - } - - /// - /// 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 to get. - /// - /// - /// 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)) - { - return operations.CreateOrUpdateAsync(parameters, resourceGroupName, networkManagerName, networkGroupName, 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 to get. - /// - /// - /// 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)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, networkGroupName, ifMatch, null, cancellationToken).ConfigureAwait(false)) - { - 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 to get. - /// - public static void Delete(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName) - { - operations.DeleteAsync(resourceGroupName, networkManagerName, networkGroupName).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 to get. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this INetworkGroupsOperations operations, string resourceGroupName, string networkManagerName, string networkGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, networkGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// 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)) - { - return operations.ListAsync(resourceGroupName, networkManagerName, top, skipToken).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)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkManagerName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// 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/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceIPConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceIPConfigurationsOperations.cs index 98a25fc6ef5d..d88a3b45390c 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceIPConfigurationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceIPConfigurationsOperations.cs @@ -94,7 +94,7 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -295,7 +295,7 @@ internal NetworkInterfaceIPConfigurationsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceLoadBalancersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceLoadBalancersOperations.cs index 83172723c07a..0314d00e8fef 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceLoadBalancersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceLoadBalancersOperations.cs @@ -94,7 +94,7 @@ internal NetworkInterfaceLoadBalancersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceTapConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceTapConfigurationsOperations.cs index ac57ddc4581e..e499e0541924 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceTapConfigurationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfaceTapConfigurationsOperations.cs @@ -126,7 +126,7 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -548,7 +548,7 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -736,15 +736,11 @@ internal NetworkInterfaceTapConfigurationsOperations(NetworkManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "tapConfigurationParameters"); } - if (tapConfigurationParameters != null) - { - tapConfigurationParameters.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfacesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfacesOperations.cs index 369b88404652..4da8c0dd9abf 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfacesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkInterfacesOperations.cs @@ -102,7 +102,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -298,7 +298,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -509,7 +509,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -737,7 +737,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -968,7 +968,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1155,7 +1155,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1338,7 +1338,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2640,7 +2640,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2819,15 +2819,11 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (parameters != null) - { - parameters.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3046,7 +3042,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3240,7 +3236,7 @@ internal NetworkInterfacesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagementClient.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagementClient.cs index 994ea2eaf0b0..3f71e49a14ac 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagementClient.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagementClient.cs @@ -303,101 +303,6 @@ public partial class NetworkManagementClient : ServiceClient public virtual INetworkInterfaceTapConfigurationsOperations NetworkInterfaceTapConfigurations { get; private set; } - /// - /// Gets the INetworkManagersOperations. - /// - public virtual INetworkManagersOperations NetworkManagers { get; private set; } - - /// - /// Gets the INetworkManagerCommitsOperations. - /// - public virtual INetworkManagerCommitsOperations NetworkManagerCommits { get; private set; } - - /// - /// Gets the INetworkManagerDeploymentStatusOperations. - /// - public virtual INetworkManagerDeploymentStatusOperations NetworkManagerDeploymentStatus { get; private set; } - - /// - /// Gets the IEffectiveVirtualNetworksOperations. - /// - public virtual IEffectiveVirtualNetworksOperations EffectiveVirtualNetworks { get; private set; } - - /// - /// Gets the IActiveConnectivityConfigurationsOperations. - /// - public virtual IActiveConnectivityConfigurationsOperations ActiveConnectivityConfigurations { get; private set; } - - /// - /// Gets the IActiveSecurityAdminRulesOperations. - /// - public virtual IActiveSecurityAdminRulesOperations ActiveSecurityAdminRules { get; private set; } - - /// - /// Gets the IActiveSecurityUserRulesOperations. - /// - public virtual IActiveSecurityUserRulesOperations ActiveSecurityUserRules { get; private set; } - - /// - /// Gets the IConnectivityConfigurationsOperations. - /// - public virtual IConnectivityConfigurationsOperations ConnectivityConfigurations { get; private set; } - - /// - /// Gets the IEffectiveConnectivityConfigurationsOperations. - /// - public virtual IEffectiveConnectivityConfigurationsOperations EffectiveConnectivityConfigurations { get; private set; } - - /// - /// Gets the INetworkManagerEffectiveSecurityAdminRulesOperations. - /// - public virtual INetworkManagerEffectiveSecurityAdminRulesOperations NetworkManagerEffectiveSecurityAdminRules { get; private set; } - - /// - /// Gets the INetworkGroupsOperations. - /// - public virtual INetworkGroupsOperations NetworkGroups { get; private set; } - - /// - /// Gets the ISecurityUserConfigurationsOperations. - /// - public virtual ISecurityUserConfigurationsOperations SecurityUserConfigurations { get; private set; } - - /// - /// Gets the IUserRuleCollectionsOperations. - /// - public virtual IUserRuleCollectionsOperations UserRuleCollections { get; private set; } - - /// - /// Gets the IUserRulesOperations. - /// - public virtual IUserRulesOperations UserRules { get; private set; } - - /// - /// Gets the ISecurityAdminConfigurationsOperations. - /// - public virtual ISecurityAdminConfigurationsOperations SecurityAdminConfigurations { get; private set; } - - /// - /// Gets the IAdminRuleCollectionsOperations. - /// - public virtual IAdminRuleCollectionsOperations AdminRuleCollections { get; private set; } - - /// - /// Gets the IAdminRulesOperations. - /// - public virtual IAdminRulesOperations AdminRules { get; private set; } - - /// - /// Gets the INetworkSecurityPerimetersOperations. - /// - public virtual INetworkSecurityPerimetersOperations NetworkSecurityPerimeters { get; private set; } - - /// - /// Gets the IPerimeterAssociableResourceTypesOperations. - /// - public virtual IPerimeterAssociableResourceTypesOperations PerimeterAssociableResourceTypes { get; private set; } - /// /// Gets the INetworkProfilesOperations. /// @@ -533,6 +438,11 @@ public partial class NetworkManagementClient : ServiceClient public virtual IServiceTagsOperations ServiceTags { get; private set; } + /// + /// Gets the IServiceTagInformationOperations. + /// + public virtual IServiceTagInformationOperations ServiceTagInformation { get; private set; } + /// /// Gets the IUsagesOperations. /// @@ -578,6 +488,11 @@ public partial class NetworkManagementClient : ServiceClient public virtual ILocalNetworkGatewaysOperations LocalNetworkGateways { get; private set; } + /// + /// Gets the IVirtualNetworkGatewayNatRulesOperations. + /// + public virtual IVirtualNetworkGatewayNatRulesOperations VirtualNetworkGatewayNatRules { get; private set; } + /// /// Gets the IVirtualNetworkTapsOperations. /// @@ -989,25 +904,6 @@ private void Initialize() NetworkInterfaceIPConfigurations = new NetworkInterfaceIPConfigurationsOperations(this); NetworkInterfaceLoadBalancers = new NetworkInterfaceLoadBalancersOperations(this); NetworkInterfaceTapConfigurations = new NetworkInterfaceTapConfigurationsOperations(this); - NetworkManagers = new NetworkManagersOperations(this); - NetworkManagerCommits = new NetworkManagerCommitsOperations(this); - NetworkManagerDeploymentStatus = new NetworkManagerDeploymentStatusOperations(this); - EffectiveVirtualNetworks = new EffectiveVirtualNetworksOperations(this); - ActiveConnectivityConfigurations = new ActiveConnectivityConfigurationsOperations(this); - ActiveSecurityAdminRules = new ActiveSecurityAdminRulesOperations(this); - ActiveSecurityUserRules = new ActiveSecurityUserRulesOperations(this); - ConnectivityConfigurations = new ConnectivityConfigurationsOperations(this); - EffectiveConnectivityConfigurations = new EffectiveConnectivityConfigurationsOperations(this); - NetworkManagerEffectiveSecurityAdminRules = new NetworkManagerEffectiveSecurityAdminRulesOperations(this); - NetworkGroups = new NetworkGroupsOperations(this); - SecurityUserConfigurations = new SecurityUserConfigurationsOperations(this); - UserRuleCollections = new UserRuleCollectionsOperations(this); - UserRules = new UserRulesOperations(this); - SecurityAdminConfigurations = new SecurityAdminConfigurationsOperations(this); - AdminRuleCollections = new AdminRuleCollectionsOperations(this); - AdminRules = new AdminRulesOperations(this); - NetworkSecurityPerimeters = new NetworkSecurityPerimetersOperations(this); - PerimeterAssociableResourceTypes = new PerimeterAssociableResourceTypesOperations(this); NetworkProfiles = new NetworkProfilesOperations(this); NetworkSecurityGroups = new NetworkSecurityGroupsOperations(this); SecurityRules = new SecurityRulesOperations(this); @@ -1035,6 +931,7 @@ private void Initialize() 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); @@ -1044,6 +941,7 @@ private void Initialize() 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); @@ -1103,16 +1001,6 @@ private void Initialize() 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 PolymorphicSerializeJsonConverter("kind")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); @@ -1220,7 +1108,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "bslRequest"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1450,7 +1338,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "sessionIds"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1653,7 +1541,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1851,7 +1739,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2081,7 +1969,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "bslRequest"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2287,7 +2175,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "bslRequest"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2470,7 +2358,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2675,7 +2563,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "vpnClientParams"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperations.cs deleted file mode 100644 index 48a740a23c13..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperations.cs +++ /dev/null @@ -1,262 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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 - { - /// - /// Initializes a new instance of the NetworkManagerCommitsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal NetworkManagerCommitsOperations(NetworkManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the NetworkManagementClient - /// - public NetworkManagementClient Client { get; private set; } - - /// - /// 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> PostWithHttpMessagesAsync(NetworkManagerCommit parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkManagerName", networkManagerName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Post", tracingParameters); - } - // Construct URL - var _baseUrl = 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _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); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - 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)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperationsExtensions.cs deleted file mode 100644 index 35f1b26a59e6..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerCommitsOperationsExtensions.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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. - /// - 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. - /// - /// - /// 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)) - { - using (var _result = await operations.PostWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerDeploymentStatusOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerDeploymentStatusOperations.cs deleted file mode 100644 index f078bf5cfe9b..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerDeploymentStatusOperations.cs +++ /dev/null @@ -1,262 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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 - { - /// - /// Initializes a new instance of the NetworkManagerDeploymentStatusOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal NetworkManagerDeploymentStatusOperations(NetworkManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the NetworkManagementClient - /// - public NetworkManagementClient Client { get; private set; } - - /// - /// Post to List of Network Manager Deployment Status. - /// - /// - /// Parameters supplied to specify which Managed Network deployment status is. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> ListWithHttpMessagesAsync(NetworkManagerDeploymentStatusParameter parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkManagerName", networkManagerName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _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); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerDeploymentStatusOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerDeploymentStatusOperationsExtensions.cs deleted file mode 100644 index e5c36f86ffe3..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerDeploymentStatusOperationsExtensions.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -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. - /// - 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. - /// - public static NetworkManagerDeploymentStatusListResult List(this INetworkManagerDeploymentStatusOperations operations, NetworkManagerDeploymentStatusParameter parameters, string resourceGroupName, string networkManagerName) - { - return operations.ListAsync(parameters, resourceGroupName, networkManagerName).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. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this INetworkManagerDeploymentStatusOperations operations, NetworkManagerDeploymentStatusParameter parameters, string resourceGroupName, string networkManagerName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerEffectiveSecurityAdminRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerEffectiveSecurityAdminRulesOperations.cs deleted file mode 100644 index 0aaed7494ff9..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerEffectiveSecurityAdminRulesOperations.cs +++ /dev/null @@ -1,262 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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; - - /// - /// NetworkManagerEffectiveSecurityAdminRulesOperations operations. - /// - internal partial class NetworkManagerEffectiveSecurityAdminRulesOperations : IServiceOperations, INetworkManagerEffectiveSecurityAdminRulesOperations - { - /// - /// Initializes a new instance of the NetworkManagerEffectiveSecurityAdminRulesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal NetworkManagerEffectiveSecurityAdminRulesOperations(NetworkManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the NetworkManagementClient - /// - public NetworkManagementClient Client { get; private set; } - - /// - /// List all effective security admin rules applied on a virtual network. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the virtual network. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, object parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (virtualNetworkName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("virtualNetworkName", virtualNetworkName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = Client.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(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _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); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerEffectiveSecurityAdminRulesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerEffectiveSecurityAdminRulesOperationsExtensions.cs deleted file mode 100644 index d1e4f7243c37..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagerEffectiveSecurityAdminRulesOperationsExtensions.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for NetworkManagerEffectiveSecurityAdminRulesOperations. - /// - public static partial class NetworkManagerEffectiveSecurityAdminRulesOperationsExtensions - { - /// - /// 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. - /// - /// - /// Parameters supplied to list correct page. - /// - public static NetworkManagerEffectiveSecurityAdminRulesListResult List(this INetworkManagerEffectiveSecurityAdminRulesOperations operations, string resourceGroupName, string virtualNetworkName, object parameters) - { - return operations.ListAsync(resourceGroupName, virtualNetworkName, parameters).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. - /// - /// - /// Parameters supplied to list correct page. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this INetworkManagerEffectiveSecurityAdminRulesOperations operations, string resourceGroupName, string virtualNetworkName, object parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperations.cs deleted file mode 100644 index 35b89b579654..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperations.cs +++ /dev/null @@ -1,1618 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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 - { - /// - /// Initializes a new instance of the NetworkManagersOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal NetworkManagersOperations(NetworkManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the NetworkManagementClient - /// - public NetworkManagementClient Client { get; private set; } - - /// - /// Gets the specified Network Manager. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkManagerName", networkManagerName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkManagerName", networkManagerName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); - } - // Construct URL - var _baseUrl = 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _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); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - 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)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes a network manager. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkManagerName", networkManagerName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); - } - // Construct URL - var _baseUrl = 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - 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)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _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); - } - return _result; - } - - /// - /// Patch a NetworkManager Tags. - /// - /// - /// Parameters supplied to update network manager tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> PatchTagsWithHttpMessagesAsync(TagsObject parameters, string resourceGroupName, string networkManagerName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkManagerName", networkManagerName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "PatchTags", tracingParameters); - } - // Construct URL - var _baseUrl = 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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("PATCH"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _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); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// List all network managers in a subscription. - /// - /// - /// 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (top > 20) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); - } - if (top < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("top", top); - tracingParameters.Add("skipToken", skipToken); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); - } - // Construct URL - var _baseUrl = 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(); - 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('"')))); - } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// 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. - /// - /// - /// 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (top > 20) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); - } - if (top < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new 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); - } - // Construct URL - var _baseUrl = 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new 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('"')))); - } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// List all network managers in a subscription. - /// - /// - /// The NextLink from the previous successful call to List 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// List network managers in a resource group. - /// - /// - /// The NextLink from the previous successful call to List 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperationsExtensions.cs deleted file mode 100644 index 496cd644173f..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkManagersOperationsExtensions.cs +++ /dev/null @@ -1,364 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// 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. - /// - public static void Delete(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName) - { - operations.DeleteAsync(resourceGroupName, networkManagerName).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. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this INetworkManagersOperations operations, string resourceGroupName, string networkManagerName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Patch a NetworkManager Tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to update network manager tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - public static NetworkManager PatchTags(this INetworkManagersOperations operations, TagsObject parameters, string resourceGroupName, string networkManagerName) - { - return operations.PatchTagsAsync(parameters, resourceGroupName, networkManagerName).GetAwaiter().GetResult(); - } - - /// - /// Patch a NetworkManager Tags. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameters supplied to update network manager tags. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The cancellation token. - /// - public static async Task PatchTagsAsync(this INetworkManagersOperations operations, TagsObject parameters, string resourceGroupName, string networkManagerName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.PatchTagsWithHttpMessagesAsync(parameters, resourceGroupName, networkManagerName, null, cancellationToken).ConfigureAwait(false)) - { - 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 IPage ListBySubscription(this INetworkManagersOperations operations, int? top = default(int?), string skipToken = default(string)) - { - return operations.ListBySubscriptionAsync(top, skipToken).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)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(top, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - 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 IPage List(this INetworkManagersOperations operations, string resourceGroupName, int? top = default(int?), string skipToken = default(string)) - { - return operations.ListAsync(resourceGroupName, 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)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// 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) - { - return 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. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionNextAsync(this INetworkManagersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - 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/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkProfilesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkProfilesOperations.cs index 65963ff53836..172a090dc667 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkProfilesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkProfilesOperations.cs @@ -119,7 +119,7 @@ internal NetworkProfilesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -325,7 +325,7 @@ internal NetworkProfilesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -551,7 +551,7 @@ internal NetworkProfilesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -738,7 +738,7 @@ internal NetworkProfilesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -921,7 +921,7 @@ internal NetworkProfilesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1110,7 +1110,7 @@ internal NetworkProfilesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityGroupsOperations.cs index 775ed12380a2..9cd975d3714f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityGroupsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityGroupsOperations.cs @@ -119,7 +119,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -352,7 +352,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -539,7 +539,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -722,7 +722,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -911,7 +911,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1096,7 +1096,7 @@ internal NetworkSecurityGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperations.cs deleted file mode 100644 index 534607527ec1..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperations.cs +++ /dev/null @@ -1,1410 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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; - - /// - /// NetworkSecurityPerimetersOperations operations. - /// - internal partial class NetworkSecurityPerimetersOperations : IServiceOperations, INetworkSecurityPerimetersOperations - { - /// - /// Initializes a new instance of the NetworkSecurityPerimetersOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal NetworkSecurityPerimetersOperations(NetworkManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the NetworkManagementClient - /// - public NetworkManagementClient Client { get; private set; } - - /// - /// Gets the specified network security perimeter by the name. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security perimeter. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string networkSecurityPerimeterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkSecurityPerimeterName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityPerimeterName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkSecurityPerimeterName", networkSecurityPerimeterName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkSecurityPerimeterName}", System.Uri.EscapeDataString(networkSecurityPerimeterName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Creates or updates a Network Security Perimeter. - /// - /// - /// Parameter supplied to create or update the network security perimeter. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security perimeter. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(NetworkSecurityPerimeter parameters, string resourceGroupName, string networkSecurityPerimeterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkSecurityPerimeterName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityPerimeterName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkSecurityPerimeterName", networkSecurityPerimeterName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkSecurityPerimeterName}", System.Uri.EscapeDataString(networkSecurityPerimeterName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _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); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - 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)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes a network security perimeter. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security perimeter. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkSecurityPerimeterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkSecurityPerimeterName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityPerimeterName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkSecurityPerimeterName", networkSecurityPerimeterName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkSecurityPerimeterName}", System.Uri.EscapeDataString(networkSecurityPerimeterName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - 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)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _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); - } - return _result; - } - - /// - /// List all network security perimeters in a subscription. - /// - /// - /// 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (top > 20) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); - } - if (top < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("top", top); - tracingParameters.Add("skipToken", skipToken); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityPerimeters").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new 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('"')))); - } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// List network security perimeters 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. - /// - /// - /// 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (top > 20) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); - } - if (top < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new 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); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new 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('"')))); - } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// List all network security perimeters in a subscription. - /// - /// - /// The NextLink from the previous successful call to List 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// List network security perimeters in a resource group. - /// - /// - /// The NextLink from the previous successful call to List 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperationsExtensions.cs deleted file mode 100644 index d7d7cc00d8b1..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkSecurityPerimetersOperationsExtensions.cs +++ /dev/null @@ -1,318 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for NetworkSecurityPerimetersOperations. - /// - public static partial class NetworkSecurityPerimetersOperationsExtensions - { - /// - /// Gets the specified network security perimeter by the name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security perimeter. - /// - public static NetworkSecurityPerimeter Get(this INetworkSecurityPerimetersOperations operations, string resourceGroupName, string networkSecurityPerimeterName) - { - return operations.GetAsync(resourceGroupName, networkSecurityPerimeterName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified network security perimeter by the name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security perimeter. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this INetworkSecurityPerimetersOperations operations, string resourceGroupName, string networkSecurityPerimeterName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkSecurityPerimeterName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a Network Security Perimeter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameter supplied to create or update the network security perimeter. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security perimeter. - /// - public static NetworkSecurityPerimeter CreateOrUpdate(this INetworkSecurityPerimetersOperations operations, NetworkSecurityPerimeter parameters, string resourceGroupName, string networkSecurityPerimeterName) - { - return operations.CreateOrUpdateAsync(parameters, resourceGroupName, networkSecurityPerimeterName).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a Network Security Perimeter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Parameter supplied to create or update the network security perimeter. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security perimeter. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this INetworkSecurityPerimetersOperations operations, NetworkSecurityPerimeter parameters, string resourceGroupName, string networkSecurityPerimeterName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(parameters, resourceGroupName, networkSecurityPerimeterName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a network security perimeter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security perimeter. - /// - public static void Delete(this INetworkSecurityPerimetersOperations operations, string resourceGroupName, string networkSecurityPerimeterName) - { - operations.DeleteAsync(resourceGroupName, networkSecurityPerimeterName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a network security perimeter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network security perimeter. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this INetworkSecurityPerimetersOperations operations, string resourceGroupName, string networkSecurityPerimeterName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkSecurityPerimeterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// List all network security perimeters 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 INetworkSecurityPerimetersOperations operations, int? top = default(int?), string skipToken = default(string)) - { - return operations.ListBySubscriptionAsync(top, skipToken).GetAwaiter().GetResult(); - } - - /// - /// List all network security perimeters 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 INetworkSecurityPerimetersOperations operations, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(top, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List network security perimeters 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 INetworkSecurityPerimetersOperations operations, string resourceGroupName, int? top = default(int?), string skipToken = default(string)) - { - return operations.ListAsync(resourceGroupName, top, skipToken).GetAwaiter().GetResult(); - } - - /// - /// List network security perimeters 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 INetworkSecurityPerimetersOperations operations, string resourceGroupName, int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, top, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List all network security perimeters 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 INetworkSecurityPerimetersOperations operations, string nextPageLink) - { - return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List all network security perimeters 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 INetworkSecurityPerimetersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List network security perimeters 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 INetworkSecurityPerimetersOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List network security perimeters 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 INetworkSecurityPerimetersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkVirtualAppliancesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkVirtualAppliancesOperations.cs index 88f8a92542c6..9951f02adde0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkVirtualAppliancesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkVirtualAppliancesOperations.cs @@ -119,7 +119,7 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -325,7 +325,7 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -544,7 +544,7 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -722,7 +722,7 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1096,7 +1096,7 @@ internal NetworkVirtualAppliancesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkWatchersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkWatchersOperations.cs index 38264005c714..c154a57274db 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkWatchersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/NetworkWatchersOperations.cs @@ -101,7 +101,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -315,7 +315,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -533,7 +533,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -722,7 +722,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -895,7 +895,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1087,7 +1087,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1571,7 +1571,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1754,7 +1754,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1979,7 +1979,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2204,7 +2204,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2429,7 +2429,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2654,7 +2654,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2880,7 +2880,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3107,7 +3107,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3334,7 +3334,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3561,7 +3561,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3784,7 +3784,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4015,7 +4015,7 @@ internal NetworkWatchersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Operations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Operations.cs index 299057dabd84..69a3456f74c1 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Operations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/Operations.cs @@ -70,7 +70,7 @@ internal Operations(NetworkManagementClient client) /// public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/P2sVpnGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/P2sVpnGatewaysOperations.cs index 1289afa50d22..92a3934fb59c 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/P2sVpnGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/P2sVpnGatewaysOperations.cs @@ -94,7 +94,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -354,7 +354,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -532,7 +532,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -854,7 +854,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "p2SVpnGatewayParameters"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1080,7 +1080,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "p2SVpnGatewayParameters"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1278,7 +1278,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1454,7 +1454,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1657,7 +1657,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1859,7 +1859,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2061,7 +2061,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "request"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2267,7 +2267,7 @@ internal P2sVpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "request"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PacketCapturesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PacketCapturesOperations.cs index 05fd5906fd7d..5c6096c97e8b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PacketCapturesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PacketCapturesOperations.cs @@ -129,7 +129,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -395,7 +395,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -602,7 +602,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -804,7 +804,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -981,7 +981,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1161,7 +1161,7 @@ internal PacketCapturesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PeerExpressRouteCircuitConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PeerExpressRouteCircuitConnectionsOperations.cs index d43a7a8e7365..3ebb8e9576e3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PeerExpressRouteCircuitConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PeerExpressRouteCircuitConnectionsOperations.cs @@ -109,7 +109,7 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -315,7 +315,7 @@ internal PeerExpressRouteCircuitConnectionsOperations(NetworkManagementClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperations.cs deleted file mode 100644 index 769ce24d4b09..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperations.cs +++ /dev/null @@ -1,240 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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; - - /// - /// PerimeterAssociableResourceTypesOperations operations. - /// - internal partial class PerimeterAssociableResourceTypesOperations : IServiceOperations, IPerimeterAssociableResourceTypesOperations - { - /// - /// Initializes a new instance of the PerimeterAssociableResourceTypesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal PerimeterAssociableResourceTypesOperations(NetworkManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the NetworkManagementClient - /// - public NetworkManagementClient Client { get; private set; } - - /// - /// Gets the list of resources that are onboarded with NSP. These resources can - /// be associated with a network security perimeter - /// - /// - /// The location of the where the association is present. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("location", location); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/perimeterAssociableResourceTypes").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperationsExtensions.cs deleted file mode 100644 index 9b60f7b572b9..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PerimeterAssociableResourceTypesOperationsExtensions.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.Network -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for PerimeterAssociableResourceTypesOperations. - /// - public static partial class PerimeterAssociableResourceTypesOperationsExtensions - { - /// - /// Gets the list of resources that are onboarded with NSP. These resources can - /// be associated with a network security perimeter - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the where the association is present. - /// - public static PerimeterAssociableResourcesListResult Get(this IPerimeterAssociableResourceTypesOperations operations, string location) - { - return operations.GetAsync(location).GetAwaiter().GetResult(); - } - - /// - /// Gets the list of resources that are onboarded with NSP. These resources can - /// be associated with a network security perimeter - /// - /// - /// The operations group for this extension method. - /// - /// - /// The location of the where the association is present. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IPerimeterAssociableResourceTypesOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateDnsZoneGroupsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateDnsZoneGroupsOperations.cs index 8b98c61ef4e1..69e27c9f6617 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateDnsZoneGroupsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateDnsZoneGroupsOperations.cs @@ -127,7 +127,7 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -353,7 +353,7 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -546,7 +546,7 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -740,7 +740,7 @@ internal PrivateDnsZoneGroupsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateEndpointsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateEndpointsOperations.cs index 021b83888e81..2f6f407dd8dd 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateEndpointsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateEndpointsOperations.cs @@ -119,7 +119,7 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -331,7 +331,7 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -504,7 +504,7 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -686,7 +686,7 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -860,15 +860,11 @@ internal PrivateEndpointsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (parameters != null) - { - parameters.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateLinkServicesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateLinkServicesOperations.cs index 21734e8da396..2811d62d0658 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateLinkServicesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PrivateLinkServicesOperations.cs @@ -119,7 +119,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -331,7 +331,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -504,7 +504,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -700,7 +700,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -907,15 +907,11 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (parameters != null) - { - parameters.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1139,7 +1135,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1370,7 +1366,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1563,7 +1559,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1754,7 +1750,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1928,15 +1924,11 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (parameters != null) - { - parameters.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2155,7 +2147,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2328,7 +2320,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2535,7 +2527,7 @@ internal PrivateLinkServicesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPPrefixesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPPrefixesOperations.cs index dc38cc3f1d64..ae3548a5df57 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPPrefixesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIPPrefixesOperations.cs @@ -119,7 +119,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -720,7 +720,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1088,15 +1088,11 @@ internal PublicIPPrefixesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (parameters != null) - { - parameters.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperations.cs index c265be1086b8..ebe57cf398f3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/PublicIpAddressesOperations.cs @@ -94,7 +94,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -310,7 +310,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -541,7 +541,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -773,7 +773,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1004,7 +1004,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1191,7 +1191,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1374,7 +1374,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2218,7 +2218,7 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2397,15 +2397,11 @@ internal PublicIPAddressesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (parameters != null) - { - parameters.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ResourceNavigationLinksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ResourceNavigationLinksOperations.cs index c25d53ab6ef8..65a2d72844b3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ResourceNavigationLinksOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ResourceNavigationLinksOperations.cs @@ -101,7 +101,7 @@ internal ResourceNavigationLinksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFilterRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFilterRulesOperations.cs index 27c88f37e919..b860ee6e751c 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFilterRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFilterRulesOperations.cs @@ -126,7 +126,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -548,7 +548,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -744,7 +744,7 @@ internal RouteFilterRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFiltersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFiltersOperations.cs index ea4e5f2f4187..cd77e451e709 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFiltersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteFiltersOperations.cs @@ -119,7 +119,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -544,7 +544,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -722,7 +722,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1092,7 +1092,7 @@ internal RouteFiltersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteTablesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteTablesOperations.cs index d9d70170100b..28074c4cf447 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteTablesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RouteTablesOperations.cs @@ -119,7 +119,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -544,7 +544,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -722,7 +722,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -909,7 +909,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1092,7 +1092,7 @@ internal RouteTablesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RoutesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RoutesOperations.cs index a05e63697750..5fbc4158ab04 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RoutesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/RoutesOperations.cs @@ -126,7 +126,7 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -548,7 +548,7 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -744,7 +744,7 @@ internal RoutesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SdkInfo_NetworkManagementClient.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SdkInfo_NetworkManagementClient.cs index eae8ba3a9017..98ae48e6a9b4 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SdkInfo_NetworkManagementClient.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SdkInfo_NetworkManagementClient.cs @@ -20,143 +20,126 @@ public static IEnumerable> ApiInfo_NetworkManageme return new Tuple[] { new Tuple("Compute", "NetworkInterfaces", "2018-10-01"), - new Tuple("Compute", "NetworkInterfaces", "2020-11-01"), + new Tuple("Compute", "NetworkInterfaces", "2021-03-01"), new Tuple("Compute", "PublicIPAddresses", "2018-10-01"), - new Tuple("Compute", "PublicIPAddresses", "2020-11-01"), - new Tuple("Network", "ActiveConnectivityConfigurations", "2021-02-01-preview"), - new Tuple("Network", "ActiveSecurityAdminRules", "2021-02-01-preview"), - new Tuple("Network", "ActiveSecurityUserRules", "2021-02-01-preview"), - new Tuple("Network", "AdminRuleCollections", "2021-02-01-preview"), - new Tuple("Network", "AdminRules", "2021-02-01-preview"), - new Tuple("Network", "ApplicationGatewayPrivateEndpointConnections", "2020-11-01"), - new Tuple("Network", "ApplicationGatewayPrivateLinkResources", "2020-11-01"), - new Tuple("Network", "ApplicationGateways", "2020-11-01"), - new Tuple("Network", "ApplicationSecurityGroups", "2020-11-01"), - new Tuple("Network", "AvailableDelegations", "2020-11-01"), - new Tuple("Network", "AvailableEndpointServices", "2020-11-01"), - new Tuple("Network", "AvailablePrivateEndpointTypes", "2020-11-01"), - new Tuple("Network", "AvailableResourceGroupDelegations", "2020-11-01"), - new Tuple("Network", "AvailableServiceAliases", "2020-11-01"), - new Tuple("Network", "AzureFirewallFqdnTags", "2020-11-01"), - new Tuple("Network", "AzureFirewalls", "2020-11-01"), - new Tuple("Network", "BastionHosts", "2020-11-01"), - new Tuple("Network", "BgpServiceCommunities", "2020-11-01"), - new Tuple("Network", "CheckDnsNameAvailability", "2020-11-01"), - new Tuple("Network", "ConnectionMonitors", "2020-11-01"), - new Tuple("Network", "ConnectivityConfigurations", "2021-02-01-preview"), - new Tuple("Network", "CustomIPPrefixes", "2020-11-01"), - new Tuple("Network", "DdosCustomPolicies", "2020-11-01"), - new Tuple("Network", "DdosProtectionPlans", "2020-11-01"), - new Tuple("Network", "DefaultSecurityRules", "2020-11-01"), - new Tuple("Network", "DeleteBastionShareableLink", "2020-11-01"), - new Tuple("Network", "DisconnectActiveSessions", "2020-11-01"), - new Tuple("Network", "DscpConfiguration", "2020-11-01"), - new Tuple("Network", "EffectiveConnectivityConfigurations", "2021-02-01-preview"), - new Tuple("Network", "EffectiveVirtualNetworks", "2021-02-01-preview"), - new Tuple("Network", "ExpressRouteCircuitAuthorizations", "2020-11-01"), - new Tuple("Network", "ExpressRouteCircuitConnections", "2020-11-01"), - new Tuple("Network", "ExpressRouteCircuitPeerings", "2020-11-01"), - new Tuple("Network", "ExpressRouteCircuits", "2020-11-01"), - new Tuple("Network", "ExpressRouteConnections", "2020-11-01"), - new Tuple("Network", "ExpressRouteCrossConnectionPeerings", "2020-11-01"), - new Tuple("Network", "ExpressRouteCrossConnections", "2020-11-01"), - new Tuple("Network", "ExpressRouteGateways", "2020-11-01"), - new Tuple("Network", "ExpressRouteLinks", "2020-11-01"), - new Tuple("Network", "ExpressRoutePorts", "2020-11-01"), - new Tuple("Network", "ExpressRoutePortsLocations", "2020-11-01"), - new Tuple("Network", "ExpressRouteServiceProviders", "2020-11-01"), - new Tuple("Network", "FirewallPolicies", "2020-11-01"), - new Tuple("Network", "FirewallPolicyRuleCollectionGroups", "2020-11-01"), - new Tuple("Network", "FlowLogs", "2020-11-01"), - new Tuple("Network", "GetActiveSessions", "2020-11-01"), - new Tuple("Network", "GetBastionShareableLink", "2020-11-01"), - new Tuple("Network", "HubRouteTables", "2020-11-01"), - new Tuple("Network", "HubVirtualNetworkConnections", "2020-11-01"), - new Tuple("Network", "InboundNatRules", "2020-11-01"), - new Tuple("Network", "InboundSecurityRule", "2020-11-01"), - new Tuple("Network", "IpAllocations", "2020-11-01"), - new Tuple("Network", "IpGroups", "2020-11-01"), - new Tuple("Network", "LoadBalancerBackendAddressPools", "2020-11-01"), - new Tuple("Network", "LoadBalancerFrontendIPConfigurations", "2020-11-01"), - new Tuple("Network", "LoadBalancerLoadBalancingRules", "2020-11-01"), - new Tuple("Network", "LoadBalancerNetworkInterfaces", "2020-11-01"), - new Tuple("Network", "LoadBalancerOutboundRules", "2020-11-01"), - new Tuple("Network", "LoadBalancerProbes", "2020-11-01"), - new Tuple("Network", "LoadBalancers", "2020-11-01"), - new Tuple("Network", "LocalNetworkGateways", "2020-11-01"), - new Tuple("Network", "NatGateways", "2020-11-01"), - new Tuple("Network", "NatRules", "2020-11-01"), - new Tuple("Network", "NetworkGroups", "2021-02-01-preview"), - new Tuple("Network", "NetworkInterfaceIPConfigurations", "2020-11-01"), - new Tuple("Network", "NetworkInterfaceLoadBalancers", "2020-11-01"), - new Tuple("Network", "NetworkInterfaceTapConfigurations", "2020-11-01"), - new Tuple("Network", "NetworkInterfaces", "2020-11-01"), - new Tuple("Network", "NetworkManagerCommits", "2021-02-01-preview"), - new Tuple("Network", "NetworkManagerDeploymentStatus", "2021-02-01-preview"), - new Tuple("Network", "NetworkManagerEffectiveSecurityAdminRules", "2021-02-01-preview"), - new Tuple("Network", "NetworkManagers", "2021-02-01-preview"), - new Tuple("Network", "NetworkProfiles", "2020-11-01"), - new Tuple("Network", "NetworkSecurityGroups", "2020-11-01"), - new Tuple("Network", "NetworkSecurityPerimeters", "2021-02-01-preview"), - new Tuple("Network", "NetworkVirtualAppliances", "2020-11-01"), - new Tuple("Network", "NetworkWatchers", "2020-11-01"), - new Tuple("Network", "Operations", "2020-11-01"), - new Tuple("Network", "P2SVpnGateways", "2020-11-01"), - new Tuple("Network", "P2sVpnGateways", "2020-11-01"), - new Tuple("Network", "PacketCaptures", "2020-11-01"), - new Tuple("Network", "PeerExpressRouteCircuitConnections", "2020-11-01"), - new Tuple("Network", "PerimeterAssociableResourceTypes", "2021-02-01-preview"), - new Tuple("Network", "PrivateDnsZoneGroups", "2020-11-01"), - new Tuple("Network", "PrivateEndpoints", "2020-11-01"), - new Tuple("Network", "PrivateLinkServices", "2020-11-01"), - new Tuple("Network", "PublicIPAddresses", "2020-11-01"), - new Tuple("Network", "PublicIPPrefixes", "2020-11-01"), - new Tuple("Network", "PutBastionShareableLink", "2020-11-01"), - new Tuple("Network", "ResourceNavigationLinks", "2020-11-01"), - new Tuple("Network", "RouteFilterRules", "2020-11-01"), - new Tuple("Network", "RouteFilters", "2020-11-01"), - new Tuple("Network", "RouteTables", "2020-11-01"), - new Tuple("Network", "Routes", "2020-11-01"), - new Tuple("Network", "SecurityAdminConfigurations", "2021-02-01-preview"), - new Tuple("Network", "SecurityPartnerProviders", "2020-11-01"), - new Tuple("Network", "SecurityRules", "2020-11-01"), - new Tuple("Network", "SecurityUserConfigurations", "2021-02-01-preview"), - new Tuple("Network", "ServiceAssociationLinks", "2020-11-01"), - new Tuple("Network", "ServiceEndpointPolicies", "2020-11-01"), - new Tuple("Network", "ServiceEndpointPolicyDefinitions", "2020-11-01"), - new Tuple("Network", "ServiceTags", "2020-11-01"), - new Tuple("Network", "Subnets", "2020-11-01"), - new Tuple("Network", "SupportedSecurityProviders", "2020-11-01"), - new Tuple("Network", "Usages", "2020-11-01"), - new Tuple("Network", "UserRuleCollections", "2021-02-01-preview"), - new Tuple("Network", "UserRules", "2021-02-01-preview"), - new Tuple("Network", "VirtualApplianceSites", "2020-11-01"), - new Tuple("Network", "VirtualApplianceSkus", "2020-11-01"), - new Tuple("Network", "VirtualHubBgpConnection", "2020-11-01"), - new Tuple("Network", "VirtualHubBgpConnections", "2020-11-01"), - new Tuple("Network", "VirtualHubIpConfiguration", "2020-11-01"), - new Tuple("Network", "VirtualHubRouteTableV2s", "2020-11-01"), - new Tuple("Network", "VirtualHubs", "2020-11-01"), - new Tuple("Network", "VirtualNetworkGatewayConnections", "2020-11-01"), - new Tuple("Network", "VirtualNetworkGateways", "2020-11-01"), - new Tuple("Network", "VirtualNetworkPeerings", "2020-11-01"), - new Tuple("Network", "VirtualNetworkTaps", "2020-11-01"), - new Tuple("Network", "VirtualNetworks", "2020-11-01"), - new Tuple("Network", "VirtualRouterPeerings", "2020-11-01"), - new Tuple("Network", "VirtualRouters", "2020-11-01"), - new Tuple("Network", "VirtualWans", "2020-11-01"), - new Tuple("Network", "VpnConnections", "2020-11-01"), - new Tuple("Network", "VpnGateways", "2020-11-01"), - new Tuple("Network", "VpnLinkConnections", "2020-11-01"), - new Tuple("Network", "VpnServerConfigurations", "2020-11-01"), - new Tuple("Network", "VpnServerConfigurationsAssociatedWithVirtualWan", "2020-11-01"), - new Tuple("Network", "VpnSiteLinkConnections", "2020-11-01"), - new Tuple("Network", "VpnSiteLinks", "2020-11-01"), - new Tuple("Network", "VpnSites", "2020-11-01"), - new Tuple("Network", "VpnSitesConfiguration", "2020-11-01"), - new Tuple("Network", "WebApplicationFirewallPolicies", "2020-11-01"), - new Tuple("Network", "WebCategories", "2020-11-01"), - new Tuple("Network", "generatevirtualwanvpnserverconfigurationvpnprofile", "2020-11-01"), + new Tuple("Compute", "PublicIPAddresses", "2021-03-01"), + new Tuple("Network", "ApplicationGatewayPrivateEndpointConnections", "2021-03-01"), + new Tuple("Network", "ApplicationGatewayPrivateLinkResources", "2021-03-01"), + new Tuple("Network", "ApplicationGateways", "2021-03-01"), + new Tuple("Network", "ApplicationSecurityGroups", "2021-03-01"), + new Tuple("Network", "AvailableDelegations", "2021-03-01"), + new Tuple("Network", "AvailableEndpointServices", "2021-03-01"), + new Tuple("Network", "AvailablePrivateEndpointTypes", "2021-03-01"), + new Tuple("Network", "AvailableResourceGroupDelegations", "2021-03-01"), + new Tuple("Network", "AvailableServiceAliases", "2021-03-01"), + new Tuple("Network", "AzureFirewallFqdnTags", "2021-03-01"), + new Tuple("Network", "AzureFirewalls", "2021-03-01"), + new Tuple("Network", "BastionHosts", "2021-03-01"), + new Tuple("Network", "BgpServiceCommunities", "2021-03-01"), + new Tuple("Network", "CheckDnsNameAvailability", "2021-03-01"), + new Tuple("Network", "ConnectionMonitors", "2021-03-01"), + new Tuple("Network", "CustomIPPrefixes", "2021-03-01"), + new Tuple("Network", "DdosCustomPolicies", "2021-03-01"), + new Tuple("Network", "DdosProtectionPlans", "2021-03-01"), + new Tuple("Network", "DefaultSecurityRules", "2021-03-01"), + new Tuple("Network", "DeleteBastionShareableLink", "2021-03-01"), + new Tuple("Network", "DisconnectActiveSessions", "2021-03-01"), + new Tuple("Network", "DscpConfiguration", "2021-03-01"), + new Tuple("Network", "ExpressRouteCircuitAuthorizations", "2021-03-01"), + new Tuple("Network", "ExpressRouteCircuitConnections", "2021-03-01"), + new Tuple("Network", "ExpressRouteCircuitPeerings", "2021-03-01"), + new Tuple("Network", "ExpressRouteCircuits", "2021-03-01"), + new Tuple("Network", "ExpressRouteConnections", "2021-03-01"), + new Tuple("Network", "ExpressRouteCrossConnectionPeerings", "2021-03-01"), + new Tuple("Network", "ExpressRouteCrossConnections", "2021-03-01"), + new Tuple("Network", "ExpressRouteGateways", "2021-03-01"), + new Tuple("Network", "ExpressRouteLinks", "2021-03-01"), + new Tuple("Network", "ExpressRoutePorts", "2021-03-01"), + new Tuple("Network", "ExpressRoutePortsLocations", "2021-03-01"), + new Tuple("Network", "ExpressRouteServiceProviders", "2021-03-01"), + new Tuple("Network", "FirewallPolicies", "2021-03-01"), + new Tuple("Network", "FirewallPolicyRuleCollectionGroups", "2021-03-01"), + new Tuple("Network", "FlowLogs", "2021-03-01"), + new Tuple("Network", "GetActiveSessions", "2021-03-01"), + new Tuple("Network", "GetBastionShareableLink", "2021-03-01"), + new Tuple("Network", "HubRouteTables", "2021-03-01"), + new Tuple("Network", "HubVirtualNetworkConnections", "2021-03-01"), + new Tuple("Network", "InboundNatRules", "2021-03-01"), + new Tuple("Network", "InboundSecurityRule", "2021-03-01"), + new Tuple("Network", "IpAllocations", "2021-03-01"), + new Tuple("Network", "IpGroups", "2021-03-01"), + new Tuple("Network", "LoadBalancerBackendAddressPools", "2021-03-01"), + new Tuple("Network", "LoadBalancerFrontendIPConfigurations", "2021-03-01"), + new Tuple("Network", "LoadBalancerLoadBalancingRules", "2021-03-01"), + new Tuple("Network", "LoadBalancerNetworkInterfaces", "2021-03-01"), + new Tuple("Network", "LoadBalancerOutboundRules", "2021-03-01"), + new Tuple("Network", "LoadBalancerProbes", "2021-03-01"), + new Tuple("Network", "LoadBalancers", "2021-03-01"), + new Tuple("Network", "LocalNetworkGateways", "2021-03-01"), + new Tuple("Network", "NatGateways", "2021-03-01"), + new Tuple("Network", "NatRules", "2021-03-01"), + new Tuple("Network", "NetworkInterfaceIPConfigurations", "2021-03-01"), + new Tuple("Network", "NetworkInterfaceLoadBalancers", "2021-03-01"), + new Tuple("Network", "NetworkInterfaceTapConfigurations", "2021-03-01"), + new Tuple("Network", "NetworkInterfaces", "2021-03-01"), + new Tuple("Network", "NetworkProfiles", "2021-03-01"), + new Tuple("Network", "NetworkSecurityGroups", "2021-03-01"), + new Tuple("Network", "NetworkVirtualAppliances", "2021-03-01"), + new Tuple("Network", "NetworkWatchers", "2021-03-01"), + new Tuple("Network", "Operations", "2021-03-01"), + new Tuple("Network", "P2SVpnGateways", "2021-03-01"), + new Tuple("Network", "P2sVpnGateways", "2021-03-01"), + new Tuple("Network", "PacketCaptures", "2021-03-01"), + new Tuple("Network", "PeerExpressRouteCircuitConnections", "2021-03-01"), + new Tuple("Network", "PrivateDnsZoneGroups", "2021-03-01"), + new Tuple("Network", "PrivateEndpoints", "2021-03-01"), + new Tuple("Network", "PrivateLinkServices", "2021-03-01"), + new Tuple("Network", "PublicIPAddresses", "2021-03-01"), + new Tuple("Network", "PublicIPPrefixes", "2021-03-01"), + new Tuple("Network", "PutBastionShareableLink", "2021-03-01"), + new Tuple("Network", "ResourceNavigationLinks", "2021-03-01"), + new Tuple("Network", "RouteFilterRules", "2021-03-01"), + new Tuple("Network", "RouteFilters", "2021-03-01"), + new Tuple("Network", "RouteTables", "2021-03-01"), + new Tuple("Network", "Routes", "2021-03-01"), + new Tuple("Network", "SecurityPartnerProviders", "2021-03-01"), + new Tuple("Network", "SecurityRules", "2021-03-01"), + new Tuple("Network", "ServiceAssociationLinks", "2021-03-01"), + new Tuple("Network", "ServiceEndpointPolicies", "2021-03-01"), + new Tuple("Network", "ServiceEndpointPolicyDefinitions", "2021-03-01"), + new Tuple("Network", "ServiceTagInformation", "2021-03-01"), + new Tuple("Network", "ServiceTags", "2021-03-01"), + new Tuple("Network", "Subnets", "2021-03-01"), + new Tuple("Network", "SupportedSecurityProviders", "2021-03-01"), + new Tuple("Network", "Usages", "2021-03-01"), + new Tuple("Network", "VirtualApplianceSites", "2021-03-01"), + new Tuple("Network", "VirtualApplianceSkus", "2021-03-01"), + new Tuple("Network", "VirtualHubBgpConnection", "2021-03-01"), + new Tuple("Network", "VirtualHubBgpConnections", "2021-03-01"), + new Tuple("Network", "VirtualHubIpConfiguration", "2021-03-01"), + new Tuple("Network", "VirtualHubRouteTableV2s", "2021-03-01"), + new Tuple("Network", "VirtualHubs", "2021-03-01"), + new Tuple("Network", "VirtualNetworkGatewayConnections", "2021-03-01"), + new Tuple("Network", "VirtualNetworkGatewayNatRules", "2021-03-01"), + new Tuple("Network", "VirtualNetworkGateways", "2021-03-01"), + new Tuple("Network", "VirtualNetworkPeerings", "2021-03-01"), + new Tuple("Network", "VirtualNetworkTaps", "2021-03-01"), + new Tuple("Network", "VirtualNetworks", "2021-03-01"), + new Tuple("Network", "VirtualRouterPeerings", "2021-03-01"), + new Tuple("Network", "VirtualRouters", "2021-03-01"), + new Tuple("Network", "VirtualWans", "2021-03-01"), + new Tuple("Network", "VpnConnections", "2021-03-01"), + new Tuple("Network", "VpnGateways", "2021-03-01"), + new Tuple("Network", "VpnLinkConnections", "2021-03-01"), + new Tuple("Network", "VpnServerConfigurations", "2021-03-01"), + new Tuple("Network", "VpnServerConfigurationsAssociatedWithVirtualWan", "2021-03-01"), + new Tuple("Network", "VpnSiteLinkConnections", "2021-03-01"), + new Tuple("Network", "VpnSiteLinks", "2021-03-01"), + new Tuple("Network", "VpnSites", "2021-03-01"), + new Tuple("Network", "VpnSitesConfiguration", "2021-03-01"), + new Tuple("Network", "WebApplicationFirewallPolicies", "2021-03-01"), + new Tuple("Network", "WebCategories", "2021-03-01"), + new Tuple("Network", "generatevirtualwanvpnserverconfigurationvpnprofile", "2021-03-01"), }.AsEnumerable(); } } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperations.cs deleted file mode 100644 index cc85eb728418..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperations.cs +++ /dev/null @@ -1,1071 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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 - { - /// - /// Initializes a new instance of the SecurityAdminConfigurationsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal SecurityAdminConfigurationsOperations(NetworkManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the NetworkManagementClient - /// - public NetworkManagementClient Client { get; private set; } - - /// - /// Lists all the network manager security admin configurations in a network - /// manager, in a paginated format. - /// - /// - /// 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (top > 20) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); - } - if (top < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new 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); - } - // Construct URL - var _baseUrl = 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new 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('"')))); - } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves a network manager security admin configuration. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager security 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new 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); - } - // Construct URL - var _baseUrl = 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("{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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - 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. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager security 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(SecurityConfiguration securityAdminConfiguration, string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (securityAdminConfiguration == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "securityAdminConfiguration"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("securityAdminConfiguration", securityAdminConfiguration); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkManagerName", networkManagerName); - tracingParameters.Add("configurationName", configurationName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); - } - // Construct URL - var _baseUrl = 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("{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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _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); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - 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)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes a network manager security admin configuration. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager security Configuration. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new 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, "Delete", tracingParameters); - } - // Construct URL - var _baseUrl = 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("{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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - 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)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _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); - } - return _result; - } - - /// - /// 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperationsExtensions.cs deleted file mode 100644 index 9e6c84bb6c31..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityAdminConfigurationsOperationsExtensions.cs +++ /dev/null @@ -1,264 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// 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; - } - } - - /// - /// 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 SecurityConfiguration Get(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName) - { - return 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)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// 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 SecurityConfiguration CreateOrUpdate(this ISecurityAdminConfigurationsOperations operations, SecurityConfiguration securityAdminConfiguration, string resourceGroupName, string networkManagerName, string configurationName) - { - return operations.CreateOrUpdateAsync(securityAdminConfiguration, resourceGroupName, networkManagerName, configurationName).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, SecurityConfiguration securityAdminConfiguration, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(securityAdminConfiguration, resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)) - { - 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. - /// - public static void Delete(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName) - { - operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName).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. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ISecurityAdminConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// 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/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityPartnerProvidersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityPartnerProvidersOperations.cs index e9e4bf35a3c0..42f69938d026 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityPartnerProvidersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityPartnerProvidersOperations.cs @@ -116,7 +116,7 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -343,7 +343,7 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -715,7 +715,7 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -902,7 +902,7 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1086,7 +1086,7 @@ internal SecurityPartnerProvidersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityRulesOperations.cs index 4b344ef09d82..6da6c5175722 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityRulesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityRulesOperations.cs @@ -126,7 +126,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +549,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -746,7 +746,7 @@ internal SecurityRulesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityUserConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityUserConfigurationsOperations.cs deleted file mode 100644 index e472a16237a8..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityUserConfigurationsOperations.cs +++ /dev/null @@ -1,1071 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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; - - /// - /// SecurityUserConfigurationsOperations operations. - /// - internal partial class SecurityUserConfigurationsOperations : IServiceOperations, ISecurityUserConfigurationsOperations - { - /// - /// Initializes a new instance of the SecurityUserConfigurationsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal SecurityUserConfigurationsOperations(NetworkManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the NetworkManagementClient - /// - public NetworkManagementClient Client { get; private set; } - - /// - /// Lists all the network manager security user configurations in a network - /// manager, in a paginated format. - /// - /// - /// 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (top > 20) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); - } - if (top < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new 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); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - List _queryParameters = new 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('"')))); - } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves a network manager security user configuration. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager security 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new 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); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Creates or updates a network manager security user configuration. - /// - /// - /// The security user 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(SecurityConfiguration securityUserConfiguration, string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (securityUserConfiguration == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "securityUserConfiguration"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("securityUserConfiguration", securityUserConfiguration); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkManagerName", networkManagerName); - tracingParameters.Add("configurationName", configurationName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(securityUserConfiguration != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(securityUserConfiguration, Client.SerializationSettings); - _httpRequest.Content = new 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) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - 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)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes a network manager security user configuration. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network manager security Configuration. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new 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, "Delete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - 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)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _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); - } - return _result; - } - - /// - /// Lists all the network manager security user configurations in a network - /// manager, in a paginated format. - /// - /// - /// The NextLink from the previous successful call to List 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityUserConfigurationsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityUserConfigurationsOperationsExtensions.cs deleted file mode 100644 index 4f007201f322..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SecurityUserConfigurationsOperationsExtensions.cs +++ /dev/null @@ -1,264 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for SecurityUserConfigurationsOperations. - /// - public static partial class SecurityUserConfigurationsOperationsExtensions - { - /// - /// Lists all the network manager security user 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 ISecurityUserConfigurationsOperations 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 user 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 ISecurityUserConfigurationsOperations 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; - } - } - - /// - /// Retrieves a network manager security user 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 SecurityConfiguration Get(this ISecurityUserConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName) - { - return operations.GetAsync(resourceGroupName, networkManagerName, configurationName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves a network manager security user 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 ISecurityUserConfigurationsOperations 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; - } - } - - /// - /// Creates or updates a network manager security user configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The security user 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 SecurityConfiguration CreateOrUpdate(this ISecurityUserConfigurationsOperations operations, SecurityConfiguration securityUserConfiguration, string resourceGroupName, string networkManagerName, string configurationName) - { - return operations.CreateOrUpdateAsync(securityUserConfiguration, resourceGroupName, networkManagerName, configurationName).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a network manager security user configuration. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The security user 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 ISecurityUserConfigurationsOperations operations, SecurityConfiguration securityUserConfiguration, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(securityUserConfiguration, resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a network manager security user 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 void Delete(this ISecurityUserConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName) - { - operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a network manager security user 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 DeleteAsync(this ISecurityUserConfigurationsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all the network manager security user 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 ISecurityUserConfigurationsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the network manager security user 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 ISecurityUserConfigurationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceAssociationLinksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceAssociationLinksOperations.cs index cd9fc3d9e5db..6769813695b7 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceAssociationLinksOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceAssociationLinksOperations.cs @@ -101,7 +101,7 @@ internal ServiceAssociationLinksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPoliciesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPoliciesOperations.cs index 3376b4e0c6e8..fa107ce9eff2 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPoliciesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPoliciesOperations.cs @@ -119,7 +119,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -538,7 +538,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -721,7 +721,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -910,7 +910,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1094,7 +1094,7 @@ internal ServiceEndpointPoliciesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPolicyDefinitionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPolicyDefinitionsOperations.cs index 21e585af4454..f761b2989503 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPolicyDefinitionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceEndpointPolicyDefinitionsOperations.cs @@ -127,7 +127,7 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -353,7 +353,7 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -551,7 +551,7 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -745,7 +745,7 @@ internal ServiceEndpointPolicyDefinitionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveVirtualNetworksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagInformationOperations.cs similarity index 66% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveVirtualNetworksOperations.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagInformationOperations.cs index 9648703b89ad..c45ff07e55e5 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/EffectiveVirtualNetworksOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagInformationOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.Network using System.Threading.Tasks; /// - /// EffectiveVirtualNetworksOperations operations. + /// ServiceTagInformationOperations operations. /// - internal partial class EffectiveVirtualNetworksOperations : IServiceOperations, IEffectiveVirtualNetworksOperations + internal partial class ServiceTagInformationOperations : IServiceOperations, IServiceTagInformationOperations { /// - /// Initializes a new instance of the EffectiveVirtualNetworksOperations class. + /// Initializes a new instance of the ServiceTagInformationOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class EffectiveVirtualNetworksOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal EffectiveVirtualNetworksOperations(NetworkManagementClient client) + internal ServiceTagInformationOperations(NetworkManagementClient client) { if (client == null) { @@ -51,26 +51,19 @@ internal EffectiveVirtualNetworksOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// List effective virtual networks in a network manager. + /// Gets a list of service tag information resources with pagination. /// - /// - /// The name of the resource group. + /// + /// 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 name of the network manager. + /// + /// Do not return address prefixes for the tag(s). /// - /// - /// Effective Virtual Networks Parameter. - /// - /// - /// 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. + /// + /// Return tag information for a particular tag. /// /// /// Headers that will be added to request. @@ -93,33 +86,17 @@ internal EffectiveVirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByNetworkManagerWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, EffectiveVirtualNetworksParameter parameters, int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string location, bool? noAddressPrefixes = default(bool?), string tagName = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (top > 20) + if (location == null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + throw new ValidationException(ValidationRules.CannotBeNull, "location"); } - if (top < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); - } - if (parameters == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-02-01-preview"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -127,33 +104,30 @@ internal EffectiveVirtualNetworksOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkManagerName", networkManagerName); + tracingParameters.Add("location", location); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("top", top); - tracingParameters.Add("skipToken", skipToken); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("noAddressPrefixes", noAddressPrefixes); + tracingParameters.Add("tagName", tagName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByNetworkManager", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listEffectiveVirtualNetworks").ToString(); + 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)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } - if (top != null) + if (noAddressPrefixes != null) { - _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("noAddressPrefixes={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(noAddressPrefixes, Client.SerializationSettings).Trim('"')))); } - if (skipToken != null) + if (tagName != null) { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + _queryParameters.Add(string.Format("tagName={0}", System.Uri.EscapeDataString(tagName))); } if (_queryParameters.Count > 0) { @@ -162,7 +136,7 @@ internal EffectiveVirtualNetworksOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -193,12 +167,6 @@ internal EffectiveVirtualNetworksOperations(NetworkManagementClient client) // 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); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -254,7 +222,7 @@ internal EffectiveVirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -267,7 +235,7 @@ internal EffectiveVirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -287,19 +255,10 @@ internal EffectiveVirtualNetworksOperations(NetworkManagementClient client) } /// - /// Lists all effective virtual networks by specified network group. + /// Gets a list of service tag information resources with pagination. /// - /// - /// The name of the resource group. - /// - /// - /// The name of the network manager. - /// - /// - /// The name of the network group to get. - /// - /// - /// Parameters supplied to list correct page. + /// + /// The NextLink from the previous successful call to List operation. /// /// /// Headers that will be added to request. @@ -322,29 +281,12 @@ internal EffectiveVirtualNetworksOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListByNetworkGroupWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string networkGroupName, QueryRequestOptions parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (networkGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkGroupName"); - } - if (parameters == null) + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } - string apiVersion = "2021-02-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -352,26 +294,14 @@ internal EffectiveVirtualNetworksOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkManagerName", networkManagerName); - tracingParameters.Add("networkGroupName", networkGroupName); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByNetworkGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL - var _baseUrl = 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}/listEffectiveVirtualNetworks").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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)); + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -379,7 +309,7 @@ internal EffectiveVirtualNetworksOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -410,12 +340,6 @@ internal EffectiveVirtualNetworksOperations(NetworkManagementClient client) // 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); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -471,7 +395,7 @@ internal EffectiveVirtualNetworksOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -484,7 +408,7 @@ internal EffectiveVirtualNetworksOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagInformationOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagInformationOperationsExtensions.cs new file mode 100644 index 000000000000..9ff6673175ef --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagInformationOperationsExtensions.cs @@ -0,0 +1,111 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// 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. + /// + /// + /// 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)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, noAddressPrefixes, tagName, null, cancellationToken).ConfigureAwait(false)) + { + 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 IPage ListNext(this IServiceTagInformationOperations operations, string nextPageLink) + { + return 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. + /// + /// + /// 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/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagsOperations.cs index fae13a4882af..665cc398f3e6 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ServiceTagsOperations.cs @@ -90,7 +90,7 @@ internal ServiceTagsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SubnetsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SubnetsOperations.cs index 3253eb516493..db66cfa78222 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SubnetsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/SubnetsOperations.cs @@ -129,7 +129,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -414,7 +414,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -612,7 +612,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -804,7 +804,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1036,7 +1036,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1232,7 +1232,7 @@ internal SubnetsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UsagesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UsagesOperations.cs index fd93aca6f982..bfce204f05ab 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UsagesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UsagesOperations.cs @@ -94,7 +94,7 @@ internal UsagesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRuleCollectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRuleCollectionsOperations.cs deleted file mode 100644 index 8fbb4e4c35fd..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRuleCollectionsOperations.cs +++ /dev/null @@ -1,1107 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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; - - /// - /// UserRuleCollectionsOperations operations. - /// - internal partial class UserRuleCollectionsOperations : IServiceOperations, IUserRuleCollectionsOperations - { - /// - /// Initializes a new instance of the UserRuleCollectionsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal UserRuleCollectionsOperations(NetworkManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the NetworkManagementClient - /// - public NetworkManagementClient Client { get; private set; } - - /// - /// Lists all the user rule collections in a security configuration, in a - /// paginated format. - /// - /// - /// 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - if (top > 20) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); - } - if (top < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new 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); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (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('"')))); - } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets a network manager security user configuration rule collection. - /// - /// - /// 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - if (ruleCollectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new 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); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Creates or updates a user rule collection. - /// - /// - /// The User 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(RuleCollection userRuleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (userRuleCollection == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "userRuleCollection"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - if (ruleCollectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("userRuleCollection", userRuleCollection); - 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, "CreateOrUpdate", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(userRuleCollection != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(userRuleCollection, Client.SerializationSettings); - _httpRequest.Content = new 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) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - 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)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes a user rule collection. - /// - /// - /// 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. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - if (ruleCollectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new 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, "Delete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - 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)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _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); - } - return _result; - } - - /// - /// Lists all the user rule collections in a security configuration, in a - /// paginated format. - /// - /// - /// The NextLink from the previous successful call to List 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRuleCollectionsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRuleCollectionsOperationsExtensions.cs deleted file mode 100644 index b0a92257d36d..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRuleCollectionsOperationsExtensions.cs +++ /dev/null @@ -1,288 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for UserRuleCollectionsOperations. - /// - public static partial class UserRuleCollectionsOperationsExtensions - { - /// - /// Lists all the user rule collections in a security 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 IUserRuleCollectionsOperations 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 user rule collections in a security 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 IUserRuleCollectionsOperations 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; - } - } - - /// - /// Gets a network manager security user 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 RuleCollection Get(this IUserRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName) - { - return operations.GetAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName).GetAwaiter().GetResult(); - } - - /// - /// Gets a network manager security user 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 IUserRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a user rule collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The User 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 RuleCollection CreateOrUpdate(this IUserRuleCollectionsOperations operations, RuleCollection userRuleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName) - { - return operations.CreateOrUpdateAsync(userRuleCollection, resourceGroupName, networkManagerName, configurationName, ruleCollectionName).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a user rule collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The User 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 IUserRuleCollectionsOperations operations, RuleCollection userRuleCollection, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(userRuleCollection, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a user 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 void Delete(this IUserRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName) - { - operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a user 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 DeleteAsync(this IUserRuleCollectionsOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all the user rule collections in a security 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 IUserRuleCollectionsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all the user rule collections in a security 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 IUserRuleCollectionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRulesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRulesOperations.cs deleted file mode 100644 index 049c7d53b77d..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRulesOperations.cs +++ /dev/null @@ -1,1141 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - 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; - - /// - /// UserRulesOperations operations. - /// - internal partial class UserRulesOperations : IServiceOperations, IUserRulesOperations - { - /// - /// Initializes a new instance of the UserRulesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal UserRulesOperations(NetworkManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the NetworkManagementClient - /// - public NetworkManagementClient Client { get; private set; } - - /// - /// Lists all user rules in a rule collection. - /// - /// - /// 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - if (ruleCollectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); - } - if (top > 20) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); - } - if (top < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkManagerName", networkManagerName); - tracingParameters.Add("configurationName", configurationName); - tracingParameters.Add("ruleCollectionName", ruleCollectionName); - tracingParameters.Add("top", top); - tracingParameters.Add("skipToken", skipToken); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (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('"')))); - } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets a user rule. - /// - /// - /// 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// 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)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - if (ruleCollectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); - } - if (ruleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new 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); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Creates or updates a user rule. - /// - /// - /// The user 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. - /// - /// - /// 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(BaseUserRule userRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (userRule == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "userRule"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - if (ruleCollectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); - } - if (ruleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("userRule", userRule); - 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, "CreateOrUpdate", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(userRule != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(userRule, Client.SerializationSettings); - _httpRequest.Content = new 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) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - 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)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes a user rule. - /// - /// - /// 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. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); - } - if (ruleCollectionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleCollectionName"); - } - if (ruleName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ruleName"); - } - string apiVersion = "2021-02-01-preview"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new 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, "Delete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(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 (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - 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)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _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); - } - return _result; - } - - /// - /// Lists all user rules in a rule collection. - /// - /// - /// The NextLink from the previous successful call to List 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 - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new 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"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRulesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRulesOperationsExtensions.cs deleted file mode 100644 index c062db8a3a89..000000000000 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/UserRulesOperationsExtensions.cs +++ /dev/null @@ -1,308 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// 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 -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for UserRulesOperations. - /// - public static partial class UserRulesOperationsExtensions - { - /// - /// Lists all user rules in a 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. - /// - /// - /// 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 IUserRulesOperations 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(); - } - - /// - /// Lists all user rules in a 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. - /// - /// - /// 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 IUserRulesOperations 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; - } - } - - /// - /// Gets a user 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 BaseUserRule Get(this IUserRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName) - { - return operations.GetAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName).GetAwaiter().GetResult(); - } - - /// - /// Gets a user 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 IUserRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates a user rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The user 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 BaseUserRule CreateOrUpdate(this IUserRulesOperations operations, BaseUserRule userRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName) - { - return operations.CreateOrUpdateAsync(userRule, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a user rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The user 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 IUserRulesOperations operations, BaseUserRule userRule, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(userRule, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Deletes a user 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 void Delete(this IUserRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName) - { - operations.DeleteAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName).GetAwaiter().GetResult(); - } - - /// - /// Deletes a user 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 DeleteAsync(this IUserRulesOperations operations, string resourceGroupName, string networkManagerName, string configurationName, string ruleCollectionName, string ruleName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists all user rules in a rule collection. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IUserRulesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all user rules in a rule collection. - /// - /// - /// 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 IUserRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSitesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSitesOperations.cs index f70daf085166..35d8053fc85f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSitesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSitesOperations.cs @@ -126,7 +126,7 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -352,7 +352,7 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -550,7 +550,7 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -743,7 +743,7 @@ internal VirtualApplianceSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSkusOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSkusOperations.cs index 449fa5d2cb9d..8c65d246ca5a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSkusOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualApplianceSkusOperations.cs @@ -80,7 +80,7 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -263,7 +263,7 @@ internal VirtualApplianceSkusOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "skuName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionOperations.cs index 9c339e4c9903..089d2a9776aa 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionOperations.cs @@ -101,7 +101,7 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -370,7 +370,7 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) { parameters.Validate(); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -595,7 +595,7 @@ internal VirtualHubBgpConnectionOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionsOperations.cs index a56174d4dcfa..450f04a3c7ee 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubBgpConnectionsOperations.cs @@ -94,7 +94,7 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -346,7 +346,7 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -550,7 +550,7 @@ internal VirtualHubBgpConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubIpConfigurationOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubIpConfigurationOperations.cs index df80073e3142..781c263ac6e5 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubIpConfigurationOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubIpConfigurationOperations.cs @@ -101,7 +101,7 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "ipConfigName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -351,7 +351,7 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -560,11 +560,7 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (parameters != null) - { - parameters.Validate(); - } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -789,7 +785,7 @@ internal VirtualHubIpConfigurationOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "ipConfigName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubRouteTableV2sOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubRouteTableV2sOperations.cs index 354cd1ec42c8..f9b6df7e2f0b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubRouteTableV2sOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubRouteTableV2sOperations.cs @@ -101,7 +101,7 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -346,7 +346,7 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -555,7 +555,7 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubRouteTableV2Parameters"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -775,7 +775,7 @@ internal VirtualHubRouteTableV2sOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "routeTableName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubsOperations.cs index 0caf9fd7fd62..be894a798bd1 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualHubsOperations.cs @@ -94,7 +94,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -321,7 +321,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubParameters"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -715,7 +715,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -943,7 +943,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { virtualHubParameters.Validate(); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1159,7 +1159,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1336,7 +1336,7 @@ internal VirtualHubsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualHubName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayConnectionsOperations.cs index 1604eab56618..7e73fcaa0710 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayConnectionsOperations.cs @@ -121,7 +121,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -393,7 +393,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -581,7 +581,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -914,7 +914,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1130,7 +1130,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1313,7 +1313,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1529,7 +1529,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1763,7 +1763,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1969,7 +1969,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2174,7 +2174,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2371,7 +2371,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2557,7 +2557,7 @@ internal VirtualNetworkGatewayConnectionsOperations(NetworkManagementClient clie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperations.cs similarity index 81% rename from sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperations.cs rename to sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperations.cs index 08b672546e7d..74d0f74fde3f 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/ConnectivityConfigurationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.Network using System.Threading.Tasks; /// - /// ConnectivityConfigurationsOperations operations. + /// VirtualNetworkGatewayNatRulesOperations operations. /// - internal partial class ConnectivityConfigurationsOperations : IServiceOperations, IConnectivityConfigurationsOperations + internal partial class VirtualNetworkGatewayNatRulesOperations : IServiceOperations, IVirtualNetworkGatewayNatRulesOperations { /// - /// Initializes a new instance of the ConnectivityConfigurationsOperations class. + /// Initializes a new instance of the VirtualNetworkGatewayNatRulesOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class ConnectivityConfigurationsOperations : IServiceOperations /// /// Thrown when a required parameter is null /// - internal ConnectivityConfigurationsOperations(NetworkManagementClient client) + internal VirtualNetworkGatewayNatRulesOperations(NetworkManagementClient client) { if (client == null) { @@ -51,17 +51,16 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) public NetworkManagementClient Client { get; private set; } /// - /// Gets a Network Connectivity Configuration, specified by the resource group, - /// network manager name, and connectivity Configuration name + /// Retrieves the details of a nat rule. /// /// - /// The name of the resource group. + /// The resource group name of the Virtual Network Gateway. /// - /// - /// The name of the network manager. + /// + /// The name of the gateway. /// - /// - /// The name of the network manager connectivity configuration. + /// + /// The name of the nat rule. /// /// /// Headers that will be added to request. @@ -84,7 +83,7 @@ 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 Task> GetWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -94,15 +93,15 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (networkManagerName == null) + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (configurationName == null) + if (natRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); } - string apiVersion = "2021-02-01-preview"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -110,20 +109,20 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkManagerName", networkManagerName); - tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); + tracingParameters.Add("natRuleName", natRuleName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = 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(); + 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); + _url = _url.Replace("{natRuleName}", System.Uri.EscapeDataString(natRuleName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -222,7 +221,7 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -235,7 +234,7 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -255,20 +254,67 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) } /// - /// Creates/Updates a new network manager connectivity configuration + /// Creates a nat rule to a scalable virtual network gateway if it doesn't + /// exist else updates the existing nat rules. /// - /// - /// Parameters supplied to create/update a network manager connectivity - /// configuration + /// + /// 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 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)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, natRuleParameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a nat rule. + /// /// - /// The name of the resource group. + /// The resource group name of the Virtual Network Gateway. /// - /// - /// The name of the network manager. + /// + /// The name of the gateway. /// - /// - /// The name of the network manager connectivity configuration. + /// + /// The name of the nat rule. + /// + /// + /// The 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)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, virtualNetworkGatewayName, natRuleName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves all nat rules for a particular virtual network gateway. + /// + /// + /// The resource group name of the virtual network gateway. + /// + /// + /// The name of the gateway. /// /// /// Headers that will be added to request. @@ -291,16 +337,8 @@ 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 Task>> ListByVirtualNetworkGatewayWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (connectivityConfiguration == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectivityConfiguration"); - } - if (connectivityConfiguration != null) - { - connectivityConfiguration.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -309,15 +347,11 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (configurationName == null) + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - string apiVersion = "2021-02-01-preview"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -325,21 +359,18 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("connectivityConfiguration", connectivityConfiguration); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkManagerName", networkManagerName); - tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByVirtualNetworkGateway", tracingParameters); } // Construct URL var _baseUrl = 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(); + 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -352,7 +383,7 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -383,12 +414,6 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) // 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); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (Client.Credentials != null) { @@ -409,7 +434,7 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -444,7 +469,7 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -457,25 +482,7 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -495,17 +502,20 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) } /// - /// Deletes a network manager connectivity configuration, specified by the - /// resource group, network manager name, and connectivity configuration name + /// Creates a nat rule to a scalable virtual network gateway if it doesn't + /// exist else updates the existing nat rules. /// /// - /// The name of the resource group. + /// The resource group name of the Virtual Network Gateway. + /// + /// + /// The name of the gateway. /// - /// - /// The name of the network manager. + /// + /// The name of the nat rule. /// - /// - /// The name of the network manager connectivity configuration. + /// + /// Parameters supplied to create or Update a Nat Rule. /// /// /// Headers that will be added to request. @@ -516,6 +526,9 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -525,7 +538,7 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string networkManagerName, string configurationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, VirtualNetworkGatewayNatRule natRuleParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -535,15 +548,19 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (networkManagerName == null) + if (virtualNetworkGatewayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); + } + if (natRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); + throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); } - if (configurationName == null) + if (natRuleParameters == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "configurationName"); + throw new ValidationException(ValidationRules.CannotBeNull, "natRuleParameters"); } - string apiVersion = "2021-02-01-preview"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -551,20 +568,21 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkManagerName", networkManagerName); - tracingParameters.Add("configurationName", configurationName); + tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); + tracingParameters.Add("natRuleName", natRuleName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("natRuleParameters", natRuleParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = 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(); + 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); - _url = _url.Replace("{configurationName}", System.Uri.EscapeDataString(configurationName)); + _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); + _url = _url.Replace("{natRuleName}", System.Uri.EscapeDataString(natRuleName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -577,7 +595,7 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -608,6 +626,12 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) // 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); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -628,7 +652,7 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -663,13 +687,49 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -678,24 +738,16 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) } /// - /// Lists all the network manager connectivity configuration in a specified - /// network manager. + /// Deletes a nat rule. /// /// - /// The name of the resource group. + /// The resource group name of the Virtual Network Gateway. /// - /// - /// The name of the network manager. + /// + /// The name of the gateway. /// - /// - /// 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 name of the nat rule. /// /// /// Headers that will be added to request. @@ -706,9 +758,6 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -718,7 +767,7 @@ 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 Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -728,19 +777,15 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (networkManagerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "networkManagerName"); - } - if (top > 20) + if (virtualNetworkGatewayName == null) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "top", 20); + throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkGatewayName"); } - if (top < 1) + if (natRuleName == null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "top", 1); + throw new ValidationException(ValidationRules.CannotBeNull, "natRuleName"); } - string apiVersion = "2021-02-01-preview"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -748,33 +793,25 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("networkManagerName", networkManagerName); - tracingParameters.Add("top", top); - tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("virtualNetworkGatewayName", virtualNetworkGatewayName); + tracingParameters.Add("natRuleName", natRuleName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = 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(); + 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("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{networkManagerName}", System.Uri.EscapeDataString(networkManagerName)); + _url = _url.Replace("{virtualNetworkGatewayName}", System.Uri.EscapeDataString(virtualNetworkGatewayName)); + _url = _url.Replace("{natRuleName}", System.Uri.EscapeDataString(natRuleName)); List _queryParameters = new 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('"')))); - } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -782,7 +819,7 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -833,7 +870,7 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -868,31 +905,13 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { ServiceClientTracing.Exit(_invocationId, _result); @@ -901,8 +920,7 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) } /// - /// Lists all the network manager connectivity configuration in a specified - /// network manager. + /// Retrieves all nat rules for a particular virtual network gateway. /// /// /// The NextLink from the previous successful call to List operation. @@ -928,7 +946,7 @@ 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 Task>> ListByVirtualNetworkGatewayNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -943,7 +961,7 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByVirtualNetworkGatewayNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -1042,7 +1060,7 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1055,7 +1073,7 @@ internal ConnectivityConfigurationsOperations(NetworkManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperationsExtensions.cs new file mode 100644 index 000000000000..ee814ec18468 --- /dev/null +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewayNatRulesOperationsExtensions.cs @@ -0,0 +1,339 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// 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 +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// 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(); + } + + /// + /// 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)) + { + (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 IPage ListByVirtualNetworkGateway(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName) + { + return operations.ListByVirtualNetworkGatewayAsync(resourceGroupName, virtualNetworkGatewayName).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; + } + } + + /// + /// 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) + { + return 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)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(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 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 Task BeginDeleteAsync(this IVirtualNetworkGatewayNatRulesOperations operations, string resourceGroupName, string virtualNetworkGatewayName, string natRuleName, CancellationToken cancellationToken = default(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 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/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewaysOperations.cs index 40fb68495c63..b4447c33942b 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkGatewaysOperations.cs @@ -120,7 +120,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -354,7 +354,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -546,7 +546,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -893,7 +893,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1196,7 +1196,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1512,7 +1512,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1728,7 +1728,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1911,7 +1911,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2117,7 +2117,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2314,7 +2314,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2499,7 +2499,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2709,7 +2709,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2912,7 +2912,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3109,7 +3109,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3309,7 +3309,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3511,7 +3511,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3724,7 +3724,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3927,7 +3927,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4126,7 +4126,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4331,7 +4331,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4528,7 +4528,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -4727,7 +4727,7 @@ internal VirtualNetworkGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "request"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperations.cs index 0ccd8566d238..038f3a3f082c 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperations.cs @@ -126,7 +126,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -294,16 +294,21 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// 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. /// /// /// The cancellation token. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -351,7 +356,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -549,7 +554,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -699,6 +704,11 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) /// 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. /// @@ -720,7 +730,7 @@ 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { @@ -746,7 +756,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -758,6 +768,7 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) tracingParameters.Add("virtualNetworkName", virtualNetworkName); tracingParameters.Add("virtualNetworkPeeringName", virtualNetworkPeeringName); tracingParameters.Add("virtualNetworkPeeringParameters", virtualNetworkPeeringParameters); + tracingParameters.Add("syncRemoteAddressSpace", syncRemoteAddressSpace); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); @@ -770,6 +781,10 @@ internal VirtualNetworkPeeringsOperations(NetworkManagementClient client) _url = _url.Replace("{virtualNetworkPeeringName}", System.Uri.EscapeDataString(virtualNetworkPeeringName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); + if (syncRemoteAddressSpace != null) + { + _queryParameters.Add(string.Format("syncRemoteAddressSpace={0}", System.Uri.EscapeDataString(syncRemoteAddressSpace))); + } if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperationsExtensions.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperationsExtensions.cs index d4c7431621d0..f6a980126589 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperationsExtensions.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkPeeringsOperationsExtensions.cs @@ -129,9 +129,14 @@ public static VirtualNetworkPeering Get(this IVirtualNetworkPeeringsOperations o /// Parameters supplied to the create or update virtual network peering /// operation. /// - public static VirtualNetworkPeering CreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters) + /// + /// 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).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace).GetAwaiter().GetResult(); } /// @@ -153,12 +158,17 @@ public static VirtualNetworkPeering CreateOrUpdate(this IVirtualNetworkPeeringsO /// 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, CancellationToken cancellationToken = default(CancellationToken)) + 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, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -266,9 +276,14 @@ public static void BeginDelete(this IVirtualNetworkPeeringsOperations operations /// Parameters supplied to the create or update virtual network peering /// operation. /// - public static VirtualNetworkPeering BeginCreateOrUpdate(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters) + /// + /// 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)) { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).GetAwaiter().GetResult(); + return operations.BeginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace).GetAwaiter().GetResult(); } /// @@ -290,12 +305,17 @@ public static VirtualNetworkPeering BeginCreateOrUpdate(this IVirtualNetworkPeer /// 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, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCreateOrUpdateAsync(this IVirtualNetworkPeeringsOperations operations, string resourceGroupName, string virtualNetworkName, string virtualNetworkPeeringName, VirtualNetworkPeering virtualNetworkPeeringParameters, string syncRemoteAddressSpace = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, syncRemoteAddressSpace, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkTapsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkTapsOperations.cs index 44def54e4fbe..c3594e0ae57a 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkTapsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworkTapsOperations.cs @@ -116,7 +116,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -342,7 +342,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -529,7 +529,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -712,7 +712,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -901,7 +901,7 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1080,15 +1080,11 @@ internal VirtualNetworkTapsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (parameters != null) - { - parameters.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworksOperations.cs index 8198937acc58..46611a9366f0 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworksOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualNetworksOperations.cs @@ -119,7 +119,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -350,7 +350,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -720,7 +720,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -919,7 +919,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1118,7 +1118,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1309,7 +1309,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1496,7 +1496,7 @@ internal VirtualNetworksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRouterPeeringsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRouterPeeringsOperations.cs index e0b0cb92bc27..2a5803877118 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRouterPeeringsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRouterPeeringsOperations.cs @@ -126,7 +126,7 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -346,7 +346,7 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -539,7 +539,7 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -731,7 +731,7 @@ internal VirtualRouterPeeringsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRoutersOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRoutersOperations.cs index 091c4bd58907..f1d109465e25 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRoutersOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualRoutersOperations.cs @@ -119,7 +119,7 @@ internal VirtualRoutersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -331,7 +331,7 @@ internal VirtualRoutersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -504,7 +504,7 @@ internal VirtualRoutersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -686,7 +686,7 @@ internal VirtualRoutersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -868,7 +868,7 @@ internal VirtualRoutersOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperations.cs index 477f05588dbd..99d91ebfa697 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VirtualWANsOperations.cs @@ -94,7 +94,7 @@ internal VirtualWansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -321,7 +321,7 @@ internal VirtualWansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "wANParameters"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal VirtualWansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -715,7 +715,7 @@ internal VirtualWansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -913,7 +913,7 @@ internal VirtualWansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "wANParameters"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1129,7 +1129,7 @@ internal VirtualWansOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnConnectionsOperations.cs index aa8debf87029..3a955929e279 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnConnectionsOperations.cs @@ -101,7 +101,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -409,7 +409,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -618,7 +618,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnConnectionParameters"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -843,7 +843,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1032,7 +1032,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1246,7 +1246,7 @@ internal VpnConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnGatewaysOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnGatewaysOperations.cs index aac3bd284911..3e8f86e2d596 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnGatewaysOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnGatewaysOperations.cs @@ -94,7 +94,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -428,7 +428,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -606,7 +606,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -808,7 +808,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { vpnGatewayParameters.Validate(); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1034,7 +1034,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnGatewayParameters"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1232,7 +1232,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1408,7 +1408,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1606,7 +1606,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1811,7 +1811,7 @@ internal VpnGatewaysOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnLinkConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnLinkConnectionsOperations.cs index c10942629591..2a0dfc2bb39d 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnLinkConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnLinkConnectionsOperations.cs @@ -159,7 +159,7 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -366,7 +366,7 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "linkConnectionName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -556,7 +556,7 @@ internal VpnLinkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "linkConnectionName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsAssociatedWithVirtualWanOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsAssociatedWithVirtualWanOperations.cs index c4afc6646191..83a400c895dd 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsAssociatedWithVirtualWanOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsAssociatedWithVirtualWanOperations.cs @@ -120,7 +120,7 @@ internal VpnServerConfigurationsAssociatedWithVirtualWanOperations(NetworkManage { throw new ValidationException(ValidationRules.CannotBeNull, "virtualWANName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsOperations.cs index d99abe8ef4e3..5883dda62289 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnServerConfigurationsOperations.cs @@ -94,7 +94,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -321,7 +321,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationParameters"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -715,7 +715,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -913,7 +913,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationParameters"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1129,7 +1129,7 @@ internal VpnServerConfigurationsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnServerConfigurationName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinkConnectionsOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinkConnectionsOperations.cs index 8fb5dcdd2956..f814ea9a3980 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinkConnectionsOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinkConnectionsOperations.cs @@ -108,7 +108,7 @@ internal VpnSiteLinkConnectionsOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "linkConnectionName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinksOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinksOperations.cs index 29b6f886a6b3..58c25a981db3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinksOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSiteLinksOperations.cs @@ -101,7 +101,7 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteLinkName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -297,7 +297,7 @@ internal VpnSiteLinksOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesConfigurationOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesConfigurationOperations.cs index 7123e2f456ea..b65c15af4aef 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesConfigurationOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesConfigurationOperations.cs @@ -131,7 +131,7 @@ internal VpnSitesConfigurationOperations(NetworkManagementClient client) { request.Validate(); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesOperations.cs index a2e680760bc0..e7f15b3ebfe8 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/VpnSitesOperations.cs @@ -94,7 +94,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -321,7 +321,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteParameters"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -537,7 +537,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -715,7 +715,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -917,7 +917,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { vpnSiteParameters.Validate(); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1133,7 +1133,7 @@ internal VpnSitesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "vpnSiteName"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebApplicationFirewallPoliciesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebApplicationFirewallPoliciesOperations.cs index 83783fcc8dfd..0999b5ea77a1 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebApplicationFirewallPoliciesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebApplicationFirewallPoliciesOperations.cs @@ -87,7 +87,7 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -265,7 +265,7 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -462,7 +462,7 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -675,7 +675,7 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client { parameters.Validate(); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -920,7 +920,7 @@ internal WebApplicationFirewallPoliciesOperations(NetworkManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebCategoriesOperations.cs b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebCategoriesOperations.cs index f9692b3b3a8a..db7124ea14ff 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebCategoriesOperations.cs +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Generated/WebCategoriesOperations.cs @@ -90,7 +90,7 @@ internal WebCategoriesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -273,7 +273,7 @@ internal WebCategoriesOperations(NetworkManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-11-01"; + string apiVersion = "2021-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; From 08ef970a6837d59eeaafcc688929610470632806 Mon Sep 17 00:00:00 2001 From: MikhailTryakhov Date: Thu, 2 Sep 2021 10:25:44 -0700 Subject: [PATCH 3/3] Added metadata --- .../AzSdk.RP.props | 2 +- .../Microsoft.Azure.Management.Network.csproj | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/sdk/network/Microsoft.Azure.Management.Network/AzSdk.RP.props b/sdk/network/Microsoft.Azure.Management.Network/AzSdk.RP.props index 6ddf9953db8c..2507e81222e9 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/AzSdk.RP.props +++ b/sdk/network/Microsoft.Azure.Management.Network/AzSdk.RP.props @@ -1,7 +1,7 @@ - Compute_2018-10-01;Network_2021-02-01; + Compute_2018-10-01;Network_2021-03-01; $(PackageTags);$(CommonTags);$(AzureApiTag); \ No newline at end of file diff --git a/sdk/network/Microsoft.Azure.Management.Network/src/Microsoft.Azure.Management.Network.csproj b/sdk/network/Microsoft.Azure.Management.Network/src/Microsoft.Azure.Management.Network.csproj index 2cb09a22bfed..1ef9e4c57fc3 100644 --- a/sdk/network/Microsoft.Azure.Management.Network/src/Microsoft.Azure.Management.Network.csproj +++ b/sdk/network/Microsoft.Azure.Management.Network/src/Microsoft.Azure.Management.Network.csproj @@ -14,16 +14,14 @@ Microsoft Azure Network management;Network;Network management;